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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.