Skip to main content
A newer version of this page is available. .

TcxCheckComboBox Class

A combo box which displays items with checkboxes, thus allowing the user to select one or several items.

Declaration

TcxCheckComboBox = class(
    TcxCustomCheckComboBox
)

Remarks

A TcxCheckComboBox control represents a combo box which can display items with checkboxes within the dropdown window. This can be useful when an end-user needs to select several options from the dropdown at once. For instance, in a time-scheduling application, you can use a check combo box with the names of weekdays allowing an end-user to select one or more days.

A check combo box editor consists of the edit region and the check list box displayed in the dropdown. The editor displays the selected items in its edit box. Once you check/uncheck an item, it is automatically added to/removed from the edit box. Edit box items are separated by delimiters (see the Properties.Delimiter property). To specify descriptions for the items displayed in the edit box and the dropdown window of the check combo box, use the ShortDescription and Description properties of the items, correspondingly.

The following screenshot shows an editor with three items selected with the dropdown closed:

and when the dropdown is open:

The items’ check states are represented by the Value property, which stores an integer value. This matches the editor’s edit value and consists of a bit for each item. The first bit controls the checked state of the first item, the second bit specifies the state of the second item and so on. An item is checked when the corresponding bit is set to 1. Otherwise, the item is unchecked.

Suppose the Value is set to 10, represented by 1010 in binary notation. This means that the second and the fourth items are displayed checked. Other items are unchecked. Do not use the Value property to set the editor’s value at run time, use the EditValue and States properties instead. The States property also provides the CheckStates editor which lets you easily customize the check states of items at design time.

The CalculateCheckStatesValue and CalculateCheckStates methods let you calculate the editor’s edit value by the items’ check states and vice versa.

TcxCheckComboBox doesn’t introduce new functionality but publishes properties and methods of its ancestor (TcxCustomCheckComboBox).

You can use TcxCheckListBox for the same purposes as a TcxCheckComboBox editor. However, the latter occupies less space on the form and provides an edit box displaying the selected options.

See Also