Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set form width and height when maximized? 1

Status
Not open for further replies.

JBlair

Programmer
May 30, 2003
76
US
When I maximize a form at design time via the WindowState property, the height and width of the form remain as if never maximized.

How do I get the maximized height and width?

I would just use Screen width and hieght, but I'm trying to take into account whether or not the person has their start menu visible or hidden.
 
Check the ScaleWidth and ScaleHeight properties... They
will not include the border width, menu and titlebar sizes
since they are not considered to be part of the client
area of the form...

D.
 
I think my meaning was misunderstood...

I want to find out the form's width and height at its maximized state. When its maximized the form.Width and .Height properties remain as if it were never maximized.
 
When you set the forms WindowsState property to maximized, this does not max the window in design mode, only after load in the resize event.

Go to the form and double click the title bar then read the Height and Width property.

Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top