Occurs when a component is clicked.
Declaration
OnClick(Sender)
Parameters
| Sender | [in] | Required | Variant |
Applies To
The event applies to the following components:
TcxButton, TcxButtonEdit, TcxCalcEdit, TcxCheckBox, TcxComboBox, TcxCurrencyEdit, TcxDateEdit, TcxGroupBox, TcxLabel, TcxListBox, TcxMemo, TcxMRUEdit, TcxRadioGroup, TcxSpinEdit, TcxTextEdit, TcxTimeEdit, TImage, TPanel
Description
Usually the OnClick event occurs when a component is clicked by the left mouse button. This event also occurs in the following cases:
- The user presses the spacebar when a
TcxButtonorTcxCheckBoxcomponent has focus. - The user selects an item in the
TcxListBoxcomponent by pressing an arrow key. - The user presses the hotkey for a
TcxButtonorTcxCheckBoxor aTcxRadioGroupcomponent's radio button. - The
Checkedproperty of aTcxCheckBoxcomponent is changed. - The
ItemIndexproperty of aTcxRadioGroupcomponent is changed. - When the user presses Enter, the
OnClickevent is generated for a form’s default button (the button whoseDefaultproperty is True). - When the user presses Esc, the
OnClickevent is generated for a form’s cancel button (the button whoseModalResultproperty ismrCancel).
You can create an event handler for the OnClick event to perform specific actions when the component is clicked.
Parameters
The event has the following parameter:
Sender
A user form component that was clicked.
Remarks
When the component is clicked, events occur in the following order:
OnDblClickOnClickOnFocusChangedOnEnter
