Link to home
Start Free TrialLog in
Avatar of ute
ute

asked on

unable to center form on screen

I have a few forms (not full size) and I need it to be centered on the screen everytime it loads. The problem is the form always runs or appear randomly on the screen. How do I fix it so that it will appear in the center of the screen?

The smaller forms will call each other and I need to have my main form (maximize) behind it "disabled" until the smaller forms are clicked. I tried setting the smaller forms to Form1.show 1 but it only shows the smaller form without the main form behind it. How to solve this too?
ASKER CERTIFIED SOLUTION
Avatar of agrillage
agrillage

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of a111a111a111
a111a111a111

Try this:

Private Sub Form_Load()
    Width = Screen.Width * 0.7
    Height = Screen.Height * 0.7
    Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2
End Sub