Skip to main content

TcxCheckBox Class

Represents a check box control that allows selecting an option.

Declaration

TcxCheckBox = class(
    TcxCustomCheckBox
)

Remarks

The TcxCheckBox class represents a check box by which a user can select an option. A check box can have two (checked, unchecked) or three (checked, unchecked and grayed) states. A TcxCheckBox control includes a check box and a caption region. Users can edit data within an editor by checking or unchecking the check box. The caption region contains the description of the check box. The following image displays the check box editor painted in the Windows® XP look & feel:

Use the Properties and style (the Style, StyleDisabled, StyleFocused and StyleHot) members to specify the behavior and look & feel of the check box editor. Working with styles is discussed in the TcxCustomEditStyle class topic.

For your check box have three states, set the AllowGrayed property of the Properties object to True. A user can switch between these states by clicking the editor with the mouse or by pressing the keyboard space bar. To set the state programmatically, use either the Checked or the State property. The Checked property is of type Boolean and can identify only checked and unchecked states. The State property is more powerful and allows you to select one of the three states.

It is possible to associate a variant value with each check box state. These values are retrieved by the EditValue property from the corresponding members of the Properties object. EditValue returns values of the ValueChecked, ValueUnchecked and ValueGrayed members for checked, unchecked and grayed states, respectively.

See Also