Home > .NET > [原创]VB.net Group Box 窗口内 自由 拖拽

[原创]VB.net Group Box 窗口内 自由 拖拽

评分 0.00, 满分 5星 0
Loading...
Go to comments
#Region " "

    Dim CurrX As Integer
    Dim CurrY As Integer
    Dim MousX As Integer
    Dim MousY As Integer
    Dim MovBoll As Boolean

    '*--将 gpbMATERIAL_INFO 更换为 自己Group Box的名字
    Private Sub gpbATT_FILE_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gpbMATERIAL_INFO.MouseDown
        MousX = e.X
        MousY = e.Y
        MovBoll = True
    End Sub

    Private Sub gpbATT_FILE_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gpbMATERIAL_INFO.MouseMove
         If MovBoll = True Then
            CurrX = sender.Left - MousX + e.X
            CurrY = sender.Top - MousY + e.Y
            sender.Location = New System.Drawing.Point(CurrX, CurrY)
        End If
    End Sub

    Private Sub gpbATT_FILE_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles gpbMATERIAL_INFO.MouseUp
        MovBoll = False
    End Sub


#End Region
声明: 本文采用 BY-NC-SA 协议进行授权. 转载请注明转自: [原创]VB.net Group Box 窗口内 自由 拖拽
Subscribe to comments feed

  1. No comments yet.
  1. Loading...