vb中怎么通过拖动控件移动窗口啊
2个回答
展开全部
Dim xCursor As Long, yCursor As Long
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button And vbLeftButton Then
xCursor = X: yCursor = Y
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button And vbLeftButton Then
Me.Move Me.Left - xCursor + X, Me.Top - yCursor + Y
End If
End Sub '
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button And vbLeftButton Then
xCursor = X: yCursor = Y
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button And vbLeftButton Then
Me.Move Me.Left - xCursor + X, Me.Top - yCursor + Y
End If
End Sub '
追问
第一句是什么
追答
声明变量啊
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
代码私信你了,看你私信。在这里发容易提交失效。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询