Application C# that occupies all screen (full screen)

  • Thread starter Thread starter Cristian Balcanu
  • Start date Start date
C

Cristian Balcanu

Hi



I want to make an application in C# that occupies all screen (full screen).
As is Internet Explorer when press F11 or Visual Studio on Ctrl-Shift-Enter.
What is the canonical way to accomplish that? Does the .NET BCL support
that? Are any links or tutorials available?



Cristi
 
This doesn't work. A margin with about 3 pixels can be seen on right.

I also want to cover the windows task-bar.

Please provide another solution.
 
I want to make an application in C# that occupies all screen (full screen).
As is Internet Explorer when press F11 or Visual Studio on Ctrl-Shift-Enter.
What is the canonical way to accomplish that? Does the .NET BCL support
that? Are any links or tutorials available?

Following method switches a form in normal mode to full window mode and
vice versa.

private void menuItemFullWindow_Click(object sender, System.EventArgs e)
{
// if the window is in normal mode (sizable) change to full window mode
if (FormBorderStyle == FormBorderStyle.Sizable)
{
// disable the window border
this.FormBorderStyle = FormBorderStyle.None;

// safe the current position and size
m_Bounds = this.Bounds;

// resize the window to full screen size and make it top most
this.Bounds = Screen.PrimaryScreen.Bounds;
this.TopMost = true;
}
else // the window is already in full mode switch back to normal mode
{
// set the position and size back to the value before full window mode
this.Bounds = m_Bounds;

// enable the window border
this.FormBorderStyle = FormBorderStyle.Sizable;
}
} // menuItemFullWindow_Click()

hth
 
Back
Top