Skip to main content

TcxCheckListBoxItems.Add Method

Adds a new item to the current collection.

Declaration

function Add: TcxCheckListBoxItem;

Returns

Type
TcxCheckListBoxItem

Remarks

The Add method creates a new item within the current collection. Add returns a new item object and this allows you to customize the item (set its text, state, and enabled status).

Individual items can be accessed via the Items property.

At design time you can add items by invoking the item editor for the TcxCustomCheckListBox.Items property by using the Object Inspector.

The following code adds three items for a check list box control and set their properties as appropriate:

with cxCheckListBox1.Items.Add do
  begin
    Text := 'Sources';
    Enabled := False;
    State := cbsChecked;
  end;
  with cxCheckListBox1.Items.Add do
  begin
    Text := 'Demos';
    State := cbsGrayed;
  end;
  with cxCheckListBox1.Items.Add do
  begin
    Text := 'Documentation';
  end;
See Also