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

How can I resize a form at runtime?

Forms

How can I resize a form at runtime?

by  Michael42  Posted    (Edited  )
Height, Width Properties Example

The example sets the size of a form to 75% of screen size, and centers the form when it is loaded.

To try this example, paste the code into the Declarations section of a form. Then press F5 and click the form.

Sub Form_Load ()
Width = Screen.Width * .75 ' Set width of form.
Height = Screen.Height * .75 ' Set height of form.
Left = (Screen.Width - Width) / 2 ' Center form horizontally.
Top = (Screen.Height - Height) / 2 ' Center form vertically.
End Sub
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top