2个回答
展开全部
Public X, Y As Integer
Private Sub Form1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
X = e.X : Y = e.Y
End Sub
Private Sub Form1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
If X = e.X And Y = e.Y Then Exit Sub
If e.Button = Windows.Forms.MouseButtons.Left Then
Me.Left = Me.Left + e.X - X
Me.Top = Me.Top + e.Y - Y
End If
End Sub
Private Sub Form1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
X = e.X : Y = e.Y
End Sub
Private Sub Form1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
If X = e.X And Y = e.Y Then Exit Sub
If e.Button = Windows.Forms.MouseButtons.Left Then
Me.Left = Me.Left + e.X - X
Me.Top = Me.Top + e.Y - Y
End If
End Sub
展开全部
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询