how to auto size the form ?

like this, i already make an exe file.

the problem is my computer setting is not the same with the other person computer. may be he set his computer setting 600 X something.
so how do we ask the form to auto resize it self ?
no need for me to mannually go to that computer and change it pixxel setting.

maybe somebody will get mad ?

how ?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You can ask windows how big the screen is, and then size your form accordingly.

For example - to start the application with the form filling the screen do this:

Form1 declarations section:

Private Const SM_CXSCREEN = 0
Private Const SM_CYSCREEN = 1
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long

Private Sub Form_Load()

Dim lWidth As Long
Dim lHeight As Long

    lWidth = GetSystemMetrics(SM_CXSCREEN)
    lHeight = GetSystemMetrics(SM_CYSCREEN)
    Me.Move 0, 0, lWidth * Screen.TwipsPerPixelX, lHeight * Screen.TwipsPerPixelY

End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
What are the sizes that you want to resize your form to?

e.g. Always resize form to half of screen size in Form_load:

Private Sub Form_Load()
    Me.Height = Screen.Height/2
    Me.Width = Screen.Width/2
End Sub

'This always centers the form.
' Put this code in form_load event
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
leess's solution resizes your form's height and width and my solution above will center the form with the size size as design size.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.