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

# TCustomCheckBox

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

TCustomCheckBox is the ancestor of all check-box components.

## Declaration

Source position: stdctrls.pp line 1184

`type TCustomCheckBox = class(TButtonControl)`
``
`class procedure WSRegisterClass; override;` |  | WSRegisterClass - Register this Class for the current Widget Set
`protected`
`procedure Click; override;` |  | Click - a procedure that allows the programmer to simulate a mouse click over the control, and initiates the same Action as that associated with the OnClick event
`procedure DoClickOnChange; virtual;`
`function RetrieveState;` |  | RetrieveState - returns the value for check box state
`procedure InitializeWnd; override;` |  | InitializeWnd calls inherited method and applies any changes
`procedure Toggle; virtual;` |  | Toggle - method to alternate between checked and unchecked states on successive activations
`function DialogChar(); override;` |  | DialogChar - a LCL Key Message; returns True if a Dialog character has an associated message
`function GetChecked; override;` |  | GetChecked - returns True if the button is checked
`procedure SetChecked(); override;` |  | SetChecked - specifies whether or not the button is checked
`procedure RealSetText(); override;` |  | Procedure to store text associated with the control in a string
`procedure ApplyChanges; virtual;` |  | ApplyChanges - method for applying specified changes
`protected`
`class function GetControlClassDefaultSize; override;` |  | GetControlClassDefaultSize - returns its own defaults, overriding the inherited values
`protected`
`procedure Loaded; override;` |  | Loaded - sends the State of the box to the interface before calling inherited method
`procedure WSSetText(); override;` |  | WSSetText - writes the name of the current widget set to a local variable
`procedure TextChanged; override;` |  | Procedure to deal with changes in text
`procedure CreateParams(); override;`
`public`
`constructor Create(); override;` |  | Create - constructor for TCustomCheckBox: calls inherited Create then initialises style, and state, bounds, tabstop and autosize
`property AllowGrayed: Boolean; [rw]` |  | Determines whether the check box can be in a "grayed" state.
`property State: TCheckBoxState; [rw]` |  | Indicates whether the check box is checked (selected), unchecked (deselected) or grayed.
`property OnChange;` |  | OnChange - event handler for any change in properties of the control
`end;`

## Inheritance

`TCustomCheckBox` |  | TCustomCheckBox is the ancestor of all check-box components.
`TButtonControl` |  | TButtonControl : ancestor class for several Button (including Radio Button) and Check Box classes
`TWinControl`
`TControl`
`TLCLComponent` |  | TLCLComponent - base class for LCL components
`TComponent,IUnknown,IInterfaceComponentReference`
`TPersistent`
`TObject`

## Description

TCustomCheckBox : The base (abstract) class from which the TCheckBox is derived.

Check boxes present the user with options that can be selected (checked) or deselected (unchecked).

## See also

TCheckBox |  | TCheckBox - a small box which can contain a check mark to indicate that it has been selected by a mouse click

The latest version of this document can be found at lazarus-ccr.sourceforge.net .