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
TcxButton
orTcxCheckBox
component has focus. - The user selects an item in the
TcxListBox
component by pressing an arrow key. - The user presses the hotkey for a
TcxButton
orTcxCheckBox
or aTcxRadioGroup
component's radio button. - The
Checked
property of aTcxCheckBox
component is changed. - The
ItemIndex
property of aTcxRadioGroup
component is changed. - When the user presses Enter, the
OnClick
event is generated for a form’s default button (the button whoseDefault
property is True). - When the user presses Esc, the
OnClick
event is generated for a form’s cancel button (the button whoseModalResult
property 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
Contains a reference to the user form component that has raised the event. That is, the component that was clicked.
Remarks
When the component is clicked, events occur in the following order:
OnDblClick
OnClick
OnFocusChanged
OnEnter