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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resize form depending on screen resolution??

Status
Not open for further replies.

DugzDMan

Programmer
Joined
Oct 19, 2000
Messages
157
Location
US
I have a program using MDI forms. When it starts up I would like the program to show the entire form (unless the user has their display settings way low :-). If I set it for 1024 x 768, it looks perfect. But, when viewed at 800 x 600, 1280 x 1024, etc. it looks horrible. Is there a way I can check the screen resolution of the computer it is running on and us a formula (or something) to set the size?

Thanks for all the help.

Doug
 
Maybe you should try this:

'Set the form to the upper left corner
FormName.Top = 0
FormName.Left = 0


'Set the width & height to max screen resolution
FormName.Width = ScaleWidth
FormName.Height= ScaleHeight


I hope this helps!
Brett Please visit my websites!
 
To get screen dimensions (in pixels), use:

w = Screen.Width / Screen.TwipsPerPixelX
h = Screen.Height / Screen.TwipsPerPixelY

Remedy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top