Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Visual Basic (Classic) FAQ


How can I resize a form at runtime? by Michael42
Posted: 13 Feb 03

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

Back to Visual Basic (Classic) FAQ Index
Back to Visual Basic (Classic) Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close