2个回答
展开全部
Dim StartX As Single
Dim StartY As Single
'将Object换成要移动的对象名
Private Sub Object_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
StartX = X
StartY = Y
End Sub
Private Sub Object_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Object.Left = Object.Left + X - StartX
Object.Top = Object.Top + Y - StartY
End If
End Sub
'VB6.0测试通过
Dim StartY As Single
'将Object换成要移动的对象名
Private Sub Object_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
StartX = X
StartY = Y
End Sub
Private Sub Object_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
Object.Left = Object.Left + X - StartX
Object.Top = Object.Top + Y - StartY
End If
End Sub
'VB6.0测试通过
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询