OnClick Event

Applies to TestComplete 15.42, last modified on September 08, 2022

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 or TcxCheckBox 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 or TcxCheckBox or a TcxRadioGroup component's radio button.
  • The Checked property of a TcxCheckBox component is changed.
  • The ItemIndex property of a TcxRadioGroup component is changed.
  • When the user presses Enter, the OnClick event is generated for a form’s default button (the button whose Default property is True).
  • When the user presses Esc, the OnClick event is generated for a form’s cancel button (the button whose ModalResult property is mrCancel).

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:

See Also

Handling Events in User Forms
OnDblClick Event
OnEnter Event

Highlight search results