|
In this example we place the code in the Forms load event procedure , so when the program is run the form is centered automatically.
Private Sub Form_Load()
Dim xpos, ypos
xpos = (Screen.Width - Form1.Width) / 2
ypos = (Screen.Height - Form1.Height) / 2
'Move form
Form1.Move xpos, ypos
End Sub
|