MouseMove 事件

       

当鼠标指针在图表上的位置改变时产生此事件。

Private Sub object_MouseMove(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long)

object   在类模块中带有事件声明的 Chart 类型对象。有关详细信息,请参阅 Chart 对象事件的用法

Button   按下的鼠标按钮。可为以下 XlMouseButton 常量之一:xlNoButton, xlPrimaryButton, xlSecondaryButton, or xlMiddleButton.

Shift   此事件产生时,Shift、Ctrl 和 Alt 的状态。可以是下列取值之一或者某几个值的和。

含义
0(零) 没有键按下
1 Shift
2 Ctrl
4 Alt

X   鼠标指针在图表对象的客户坐标系中的 X 坐标。

Y   鼠标指针在图表对象的客户坐标系中的 Y 坐标。

示例

当在图表上移动鼠标指针时,运行本示例。

Private Sub Chart_MouseMove(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long)
    MsgBox "X = " & X & " Y = " & Y
End Sub