I heard there is a way to have a form centered directly in the middle of the screen when the program is ran. Can you tell me the code?
Thanks
Printable View
I heard there is a way to have a form centered directly in the middle of the screen when the program is ran. Can you tell me the code?
Thanks
In design time, set the StartUpPositon property of the form to CenterScreen
in code it looks like this:
[Edited by HeSaidJoe on 09-09-2000 at 11:23 PM]Code:Private Sub Form_Activate()
Me.Left = (Screen.Width / 2) - (Me.Width / 2)
Me.Top = (Screen.Height / 2) - (Me.Height / 2)
End Sub
in the form proprity, you can find
START UP POSITION
set at CENTER SCREEN