Table of contents
TOC
折叠目录
展开目录

Rectangle.Click 事件 (访问)Rectangle.Click Event (Access)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

当用户按下并在一个对象上释放鼠标按钮时, Click事件发生。The Click event occurs when the user presses and then releases a mouse button over an object.

语法Syntax

表达式单击expression. Click

表达式_一个表示矩形对象的变量。_expression A variable that represents a Rectangle object.

注解Remarks

  • 此事件适用于包含超链接的控件。This event applies to a control containing a hyperlink.

若要在该事件发生时运行宏或事件过程,请将OnClick属性设置为宏的名称或 [事件过程]。To run a macro or event procedure when this event occurs, set the OnClick property to the name of the macro or to [Event Procedure].

对于控件,用户执行以下操作时发生此事件:For a control, this event occurs when the user:

  • 用鼠标左键单击控件。用右边或中间的鼠标键单击控件不会触发此事件。Clicks a control with the left mouse button. Clicking a control with the right or middle mouse button does not trigger this event.

  • 单击包含超链接数据使用鼠标左的按钮控件。用右边或中间的鼠标键单击控件不会触发此事件。当用户将鼠标指针移动包含超链接数据,鼠标指针将变为"手"形图标的控件。当用户单击鼠标键时,超链接将被激活,然后Click事件发生。Clicks a control containing hyperlink data with the left mouse button. Clicking a control with the right or middle mouse button does not trigger this event. When the user moves the mouse pointer over a control containing hyperlink data, the mouse pointer changes to a "hand" icon. When the user clicks the mouse button, the hyperlink is activated, and then the Click event occurs.

  • 通过按箭头键后再按 Enter 键,或通过单击鼠标按钮,在组合框或列表框中选择一项。Selects an item in a combo box or list box, either by pressing the arrow keys and then pressing the ENTER key or by clicking the mouse button.

  • 当命令按钮、复选框、选项按钮或切换按钮具有焦点时按空格键。Presses SPACEBAR when a command button, check box, option button, or toggle button has the focus.

  • 在命令按钮的默认值属性设置为是的窗体上按 ENTER 键。Presses the ENTER key on a form that has a command button whose Default property is set to Yes.

  • 在命令按钮的Cancel属性设置为是的窗体上按 ESC 键。Presses the ESC key on a form that has a command button whose Cancel property is set to Yes.

  • 按下某个控件的访问键。例如,如果某个命令按钮的标题属性设置为&;转,按 ALT + G 会触发该事件。Presses a control's access key. For example, if a command button's Caption property is set to &;Go, pressing ALT+G triggers the event.

通常情况下,将一个Click事件过程或宏附加到命令按钮以执行某些命令和类似命令的操作。其他适用的控件,使用此事件来触发操作以响应本主题前面所述的情况之一。Typically, you attach a Click event procedure or macro to a command button to carry out commands and command-like actions. For the other applicable controls, use this event to trigger actions in response to one of the occurrences discussed earlier in this topic.

可以在 DblClick 宏中使用CancelEvent操作取消的第二个Click事件。有关详细信息,请参阅 DblClick 事件主题。You can use a CancelEvent action in a DblClick macro to cancel the second Click event. For more information, see the DblClick event topic.

若要区分的左边、 右边和中间的鼠标按钮,请使用MouseDownMouseUp事件。To distinguish between the left, right, and middle mouse buttons, use the MouseDown and MouseUp events.

另请参阅See also

概念Concepts

矩形对象Rectangle Object

© 2018 Microsoft