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
 
Thanks Kevin.


Kevin Spencer said:
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top