当在图表上按下鼠标按钮时,产生此事件。
Private Sub object_MouseDown(ByVal Button As Long, ByVal Shift As Long, ByVal X As Long, ByVal Y As Long)
object 在类模块中带有事件声明的 Chart 类型对象。有关详细信息,请参阅 Chart 对象事件的用法。
Button 按下的鼠标按钮。可为以下 XlMouseButton 常量之一:xlNoButton、xlPrimaryButton、xlSecondaryButton 或 xlMiddleButton。
Shift 此事件产生时 Shift、Ctrl 和 Alt 的状态。可以是下列值之一或者某几个值的和。
值 | 含义 |
---|---|
0(零) | 没有键按下 |
1 | Shift |
2 | Ctrl |
4 | Alt |
X 鼠标指针在图表对象的客户坐标系中的 X 坐标。
Y 鼠标指针在图表对象的客户坐标系中的 Y 坐标。
当在图表上按下鼠标按钮时,运行本示例。
Private Sub Chart_MouseDown(ByVal Button As Long, _
ByVal Shift As Long, ByVal X As Long, ByVal Y As Long)
MsgBox "Button = " & Button & chr$(13) & _
"Shift = " & Shift & chr$(13) & _
"X = " & X & " Y = " & Y
End Sub