Maximize a Winform Width

  • Thread starter Thread starter sloan
  • Start date Start date
S

sloan

Probably an easy question but here goes:

A 2.0 winform.

How (on startup) should I properly make the width, the max of the user's
screen?

...
 
Screen.PrimaryScreen.WorkingArea

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
In a single-monitor context it's reasonably simple:

myForm.Width = Screen.PrimaryScreen.Bounds.Width;
or
myForm.Width = Screen.PrimaryScreen.WorkingArea.Width;

(the above widths can be different, you need to decide which one to use).

In a multi-monitor contet it's more complex, you'll need to define what your
requirements are. Should the width be the width spanning all monitors or a
single monitor? If it's a single monitor, what's the criteria for choosing
which monitor?
 
Back
Top