Show Full Screen Mode In C# | Free Source Code

Show Full Screen Mode in C#

fullscreendesign_2

In this tutorial, I will teach you how to create a C# program that can view full screen of your interface.

Let’s start this tutorial!

1. Create a Windows Form Application in C# for this tutorial by following steps in Microsoft Visual Studio 2019: Go to File, click New Project, and choose Windows Application.

2. Add only one Button named Button1 and labeled it as “Show FullScreen”. You must design your interface like this:

input

3. In your button1 as show fullscreen button, put this code below.

private void Button1_Click(System.Object sender, System.EventArgs e)
{
    this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
    this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
    this.TopMost = true;
}

Take note that the keyword this here refers to our current form. We get the style property of our border into none, meaning there is no title bar in the form. The windows state is set to maximize to set the form in its full screen form without having a title bar. TopMost property of the form is set to true so that it will overlap all the forms inside the project.

Output:

output

Facebook Comments

Leave a Reply

Your email address will not be published.