### Center Form on PrimaryScreen

This is a solution to center a Form on the PrimaryScreen.
`Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
MainForm.Show
CenterFormOnScreen(MainForm)
End Sub`
'Centers a form on the primary screen
`Sub CenterFormOnScreen(Frm As Form)
Dim ps As Screen = fx.PrimaryScreen
Frm.WindowTop = (ps.MaxY - ps.MinY) / 2 - Frm.Height / 2
Frm.WindowLeft = (ps.MaxX - ps.MinX) / 2 - Frm.Width / 2
End Sub`

Changed: , Category: Forms, File: T6C195M1406.htm, ID: 1406