24

Possible Duplicate:
How to retrieve the Screen Resolution from a C# winform app?

How can I get the screen size in Windows forms?

Community
  • 1
  • 1
Anshuman Jasrotia
  • 3,135
  • 8
  • 48
  • 81
  • See here: http://stackoverflow.com/questions/2402739/how-to-retrieve-the-screen-resolution-from-a-c-sharp-winform-app – Alex J Oct 10 '12 at 10:13
  • [This has both](http://stackoverflow.com/questions/254197/how-can-i-get-the-active-screen-dimensions) the WinForms and WPF solution – Steve Rowe Oct 10 '12 at 10:49

1 Answers1

57

Check the Screen class and its property Bounds

Screen.PrimaryScreen.Bounds.Width;
Screen.PrimaryScreen.Bounds.Height;
Screen.PrimaryScreen.Bounds.Size;
Steve
  • 213,761
  • 22
  • 232
  • 286
  • 21
    CAUTION: On a MULTIPLE MONITOR system, what you might instead want to know is the size of the screen THAT A SPECIFIC FORM is on. For this, use Screen.FromControl(myForm). See http://stackoverflow.com/questions/2402739/how-to-retrieve-the-screen-resolution-from-a-c-sharp-winform-app for more details. – ToolmakerSteve Oct 10 '13 at 17:43
  • for multiple screen system. one could get the the screen that holds the largest portion of the main form from the app's main form like: Screen.FromControl(this).WorkingArea; – gg89 Jun 25 '16 at 17:39
  • 1
    Caution number 2: This won't work on 64 bit mono on macos (because winforms is not implemented for 64bit yet). I just tripped on this. – Tyron Apr 13 '18 at 19:24