Pedro Ávila Pedro Ávila - 8 days ago 5
C# Question

Size forms for various sizes of suits Monitors

I'm working on a desktop app Windows Forms

I'm working on a

19
' but what if I install the app where you have a monitor less measured as
14
' or less maybe.

What I'm doing is creating my main form with
1024
x
768
but as to create my other forms is necessary to lower my screen resolution to
1024
x
768
?

Answer

If you want to be able to manipulate your forms size depending on the size of the screen, then I recommend using Screen.GetWorkingArea(), but just to add on to @jaredbaszler. This is what the documentation states about GetWorkingArea:

Retrieves the working area for the display that contains the largest region of the specified control. The working area is the desktop area of the display, excluding taskbars, docked windows, and docked tool bars.

It will only provide the screen height and width values as if nothing was within the screen. I would say that the working area would be your best option though.

Comments