第1个回答 推荐于2017-11-24
mousemove事件就是鼠标在对象上移动
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Cls
Print "鼠标在按钮上移动" & Now
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Cls
Print "鼠标在窗体移动" & Now
End Sub本回答被网友采纳
第2个回答 2011-05-09
放上一个picture控件,然后
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Picture1.PSet (X, Y), &HFF&‘x,y是当前鼠标所在点的坐标,&HFF&是颜色
End Sub
鼠标在picture控件上移动时会画出一条红线
若要鼠标按住左键后才画出红线,可以加个判断
If Button <> 1 Then Exit Sub
第3个回答 2011-05-08
这是鼠标移动时发生的事件,如:
Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
MsgBox "你点到我啦!"
End Sub
当鼠标移动到这个标签控件的时候,就弹出对话框
第4个回答 2011-05-09
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Cls
Circle (X, Y), Rnd * 1000, RGB(255 * Rnd, 255 * Rnd, 255 * Rnd)
End Sub
圆形相随——鼠标移动,光环跟进!