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

# TCustomCheckListBox

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

The base class for TCheckListBox, a list box with check box items.

## Declaration

Source position: checklst.pas line 36

`type TCustomCheckListBox = class(TCustomListBox)`
`protected`
`class procedure WSRegisterClass; override;` |  | Registers this component class with the current WidgetSet.
`procedure AssignItemDataToCache(); override;` |  | Stores the data for an item at the specified position in the cache for item data.
`procedure AssignCacheToItemData(); override;` |  | Retrieves data for an item at the specified position from the cache for item data.
`procedure DrawItem(); override;` |  | Adjusts the drawing area for the specified item, and renders it on the control.
`function GetCachedDataSize; override;` |  | Gets the data size for a TCachedItemData entry in the item cache.
`function GetCheckWidth;` |  | Gets the width required for the check box drawn for Items on the control.
`procedure DefineProperties(); override;` |  | Defines which non-published properties should be streamed (none here).
`procedure ReadData();` |  | Reads the data for the control from the specified stream.
`procedure WriteData();` |  | Writes data for the control to the specified stream.
`procedure ClickCheck; virtual;` |  | Performs actions needed when a value in the control is about to change.
`procedure ItemClick(); virtual; deprecated ;` |  | Deprecated. Performs actions when the specified check box has been changed using the mouse or the keyboard.
`procedure KeyDown(); override;` |  | Handles key down messages for the control.
`procedure FontChanged(); override;` |  | Recalculates the height for check box Items in the control when the Font is changed.
`public`
`constructor Create(); override;` |  | Constructor for the class instance.
`function CalculateStandardItemHeight; override;` |  | Calculates the height for an item displayed on the check list control.
`procedure Toggle();` |  | Toggles the Checked, Unchecked, Grayed state for the specified item in the control.
`procedure CheckAll();` |  | Sets the specified values for State, AllowGrayed, and ItemEnabled for all Items in Control.
`procedure Exchange();` |  | Swaps the values for the State properties in the Items at the specified ordinal positions.
`property AllowGrayed: Boolean; [rw]` |  | Indicates if the item can use the "grayed" (or unselectable) check box state.
`property Checked []: Boolean; [rw]` |  | Provides indexed access to the Boolean Checked or Unchecked state for Items in the control.
`property Header []: Boolean; [rw]` |  | Provides indexed access to header usage status for Items in the control.
`property HeaderBackgroundColor: TColor; [rw]` |  | Color used to paint the background for Header items on the control.
`property HeaderColor: TColor; [rw]` |  | Color used for the text on a Header item.
`property ItemEnabled []: Boolean; [rw]` |  | Provides indexed access to the enabled state for Items in the control.
`property State []: TCheckBoxState; [rw]` |  | Provides indexed access to the TCheckBoxState for Items in the control.
`property OnClickCheck: TNotifyEvent; [rw]` |  | Event handler signalled when a check box in the control has been changed.
`property OnItemClick: TCheckListClicked; [rw] deprecated ;` |  | Deprecated. Event handler signalled when the check box state for a specific item has been changed.
`end;`

## Inheritance

`TCustomCheckListBox` |  | The base class for TCheckListBox, a list box with check box items.
`TCustomListBox` |  | The base class for TListBox.
`TWinControl` |  | Implements a windowed control which can contain other child controls.
`TControl` |  | The base class for visible controls.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

TCustomCheckListBox is a TCustomListBox descendant which defines the base class used to implement TCheckListBox. It is a list box control which displays check boxes for items added to the list. It provides the scrolling, selection, and drawing styles inherited from the ancestor class. It also includes the ability to render its items as a check box, and respond to mouse or keyboard events when the checked state for an item is toggled.

## See also

TCustomListBox
TCheckListBox |  | TCheckListBox implements a list box with check boxes for its items.