[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'StdCtrls' (#lcl)

# TCustomCheckBox.Click

Performs actions needed when the control is clicked.

## Declaration

Source position: stdctrls.pp line 1340

`protected procedure TCustomCheckBox.Click; override;`

## Description

Click is an overridden method in TCustomCheckBox. It performs actions needed when the value in the Checked or State property is changed for the control, whether by mouse click or setting the value in program code.

TCustomCheckBox re-implements the method from the TButtonControl ancestor to ignore the mouse click event. It has an empty implementation, and does not call the inherited method.

In TCustomCheckBox, the click action may be handled in two different ways. The action may be performed (in TControl) when the left mouse button is released and standard click events are enabled in ControlStyle. The click action may be performed in DoClickOnChange (by calling the inherited Click method) when the value in State is changed and ClicksDisabled is False.

This avoids a duplicate click notification when csClickEvents is enabled in ControlStyle and Click is handled when the WMLButtonUp method is executed, or when the click is triggered by an associated Action.

## See also

TCustomCheckBox.State |  | The check, unchecked, or grayed state for the control.
TCustomCheckBox.DoClickOnChange |  | Implements the Click behavior for the control.
TButtonControl.Checked |  | Indicates the checked state for the control as a Boolean value.
TButtonControl.ClicksDisabled |  | Disables calling the Click method without changing the Enabled state for the control.
TControl.Click |  | Signals OnClick and/or executes the ActionLink when the control has been clicked.
TControl.Action |  | The Action associated with the control.
TControl.ControlState |  | Contains state flags which indicate whether the control has been clicked, data is being read, or the control is being re-drawn, etc.
TControl.ControlStyle |  | Contains style flags which control the features or behaviors enabled for the control.
TControl.WMLButtonUp |  | Message handler for left mouse button up events.