You must install:
Form1.StartPosition = FormStartPosition.Manual
Edit:
Here is a working example:
Dim X As Integer = (Screen.PrimaryScreen.Bounds.Width - Me.Width) / 2 Dim Y As Integer = (Screen.PrimaryScreen.Bounds.Height - Me.Height) / 2 Me.StartPosition = FormStartPosition.Manual Me.Location = New System.Drawing.Point(X, Y)
Edit 2:
Here is the improved code based on Hans Passant comments (much better):
Dim mainScreen As Screen = Screen.FromPoint(Me.Location) Dim X As Integer = (mainScreen.WorkingArea.Width - Me.Width) / 2 + mainScreen.WorkingArea.Left Dim Y As Integer = (mainScreen.WorkingArea.Height - Me.Height) / 2 + mainScreen.WorkingArea.Top Me.StartPosition = FormStartPosition.Manual Me.Location = New System.Drawing.Point(X, Y)
source share