How can I retrieve the screen resolution that my C# Winform App is running on?
A:
More complex than you think.
Which screen?
Dont assume there is only one.
So, in general - this is a REALLY nontrivial question. What do you try to achieve?
TomTom
2010-03-08 16:19:33
A:
Use the Screen class, and interrogate the Bounds property. The Screen class has a static property for Primary Screen, and another static property that returns a list of all the screens attached to the system.
Nick
2010-03-08 16:23:13
+4
A:
Do you need just the area a standard application would use, i.e. excluding the Windows taskbar and docked windows? If so, use the Screen.WorkingArea property. Otherwise, use Screen.Bounds.
If there are multiple monitors, you need to grab the screen from your form, i.e.
Form myForm;
Screen myScreen = Screen.FromControl(myForm);
Rectangle area = myScreen.WorkingArea;
Paul Williams
2010-03-08 16:23:19