ComboBox.Click 事件 (Access)ComboBox.Click event (Access)

Click 事件發生於使用者按下及物件後再放開滑鼠按鈕時。The Click event occurs when the user presses and then releases a mouse button over an object.

語法Syntax

運算式按一下 [expression.Click

_運算式_代表**ComboBox** 物件的變數。expression A variable that represents a ComboBox 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.

  • 下拉式方塊的值會認可變更。Commits a change to the value of the combo box. 在此例中 AfterUpdate 事件之後和 Exit 事件之前就會引發 Click 事件。In this case, the Click event fires after the AfterUpdate event and before the Exit event.

  • 按一下含有超連結資料與滑鼠左鍵的控制項。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. 當使用者將滑鼠指標停留包含超連結資料、 滑鼠指標變更為"hand"圖示的控制項。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.

  • 有命令按鈕的Default屬性設定為 [是] 表單上按下 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.

  • 按下控制項的便捷鍵。Presses a control's access key. 例如,如果命令按鈕的Caption屬性設為 &Go,按 Alt + G 觸發事件。For example, if a command button's Caption property is set to &Go, pressing Alt+G triggers the event.

通常,您會將 按一下 [ 事件程序或巨集附加到命令按鈕為了命令和命令類似的動作。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 事件。You can use a CancelEvent action in a DblClick macro to cancel the second Click event. 如需詳細資訊,請參閱**DblClick** 事件主題。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.

支援和意見反應Support and feedback

有關於 Office VBA 或這份文件的問題或意見反應嗎?Have questions or feedback about Office VBA or this documentation? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.