'將下列Sub放置到  Me.Resize,當控制項變化時會自動調整位置

  Private Sub WindowToCenter()
        Dim sx As Integer = Screen.PrimaryScreen.Bounds.Width
        Dim sy As Integer = Screen.PrimaryScreen.Bounds.Height
        Me.Left = (sx - Me.Width) / 2
        Me.Top = (sy - Me.Height) / 2
    End Sub
arrow
arrow
    全站熱搜

    colud77 發表在 痞客邦 留言(0) 人氣()