Quantcast
Viewing all articles
Browse latest Browse all 12583

How do I Maximize my form on startup? C#

I have this code to check the size last used on my form (in Settings). If the form's size is the screen's size (working area), I want to maximize it.

 

Code Snippet

Size =

Settings.Default.Size;

if

(Size == Screen.GetWorkingArea(this).Size)

{

if (WindowState == FormWindowState.Normal)

{

WindowState =

FormWindowState.Maximized;

}

 

This code does not work, however. It doesn't maximize.

 

Any help would be greatly appreciated.


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>