Form/ 폼 중앙 배치

VNote 2018.03.13 21:58:25 *: Me.Location = New Point(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width() / 2 - 200, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height() / 2 - 200)

원래 폼 사이즈 800*400 폼을 400,400 사이즈 변경 후

 

중앙에 위치하게

 

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Me.Size = New System.Drawing.Size(400, 400)

        Me.Location = New Point(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width() / 2 - 200, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height() / 2 - 200)

    End Sub