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
Oct 19, 2000
157
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
 
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