1个回答
展开全部
Dim mouseIsDown As Boolean
Dim cy As Single
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
cy = Y
mouseIsDown = True
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If mouseIsDown Then
Picture1.Move Picture1.Left, IIf(Y - cy < 0, Picture1.Top + (Y - cy), Picture1.Top) '向上
' Picture1.Move Picture1.Left, IIf(Y - cy > 0, Picture1.Top + (Y - cy), Picture1.Top) '向下
End If
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
mouseIsDown = False
End Sub
'****比如移动Picture1,添加一个Picture1
已经修改
Dim cy As Single
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
cy = Y
mouseIsDown = True
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If mouseIsDown Then
Picture1.Move Picture1.Left, IIf(Y - cy < 0, Picture1.Top + (Y - cy), Picture1.Top) '向上
' Picture1.Move Picture1.Left, IIf(Y - cy > 0, Picture1.Top + (Y - cy), Picture1.Top) '向下
End If
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
mouseIsDown = False
End Sub
'****比如移动Picture1,添加一个Picture1
已经修改
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询