Saturday, July 10, 2010

Run Application in Fullscreen

Some beginners would maybe say, that it is not possible to write "real" applications in C#, as for example with C++, because all C# application look the same, having this predefined border, menu etc.
C# though is a also in professional fields widely used language.
On the one hand WPF is the type of C# application you are looking for if you want to create fancy looking applications.
On the other hand, the mentioned menu and border can easily be hidden and the prorgam can be run in fullscreen mode, so that also the taskbar is hidden.
Therefore 3 properties have to be set (best in Form_Load() or in the constructor of the form), the following example explains these:

private void Form1_Load(object sender, EventArgs e)
{
    this.FormBorderStyle = FormBorderStyle.None; // hide border
    this.TopMost = true// show form in the very front, meaning also in front of the task bar
    this.Bounds = Screen.PrimaryScreen.Bounds; // set form size to screen size
}

No comments:

Post a Comment