Skip to main content

TcxImageComboBoxItems Class

A collection of image combo box items.

Declaration

TcxImageComboBoxItems = class(
    TOwnedCollection
)

Remarks

TcxImageComboBox and TcxDBImageComboBox editors use a TcxImageComboBoxItems collection to manage items available for selection.

Main API Members

The list below outlines key members of the TcxImageComboBoxItems class. These members allow you to manage image combo box items.

Collection Management

Add
Creates a new image combo box item and adds it to the end of the collection.
Clear
Clears the collection.
Count
Returns the number of stored image combo box items.
Delete
Allows you to delete individual image combo box items.
Items
Provides indexed access to stored image combo box items.

General-Purpose API Members

Assign
Copies items between image combo box item collections.
BeginUpdate | EndUpdate
Allow you to avoid excessive redraw operations during batch collection changes.

Code Example

The following code example creates and configures four image combo box items:

var
  AItem: TcxImageComboBoxItem;
  AProperties: TcxImageComboBoxProperties;
begin
  AProperties := cxImageComboBox1.Properties;
  AProperties.BeginUpdate;
  try
    AItem := AProperties.Items.Add;
    AItem.ImageIndex := 0;
    AItem.Description := 'Dr';
    AItem.Value := 0;
    AItem := AProperties.Items.Add;
    AItem.ImageIndex := 1;
    AItem.Description := 'Mr';
    AItem.Value := 1;
    AItem := AProperties.Items.Add;
    AItem.ImageIndex := 2;
    AItem.Description := 'Ms';
    AItem.Value := 2;
    AItem := AProperties.Items.Add;
    AItem.ImageIndex := 3;
    AItem.Description := 'Mrs';
    AItem.Value := 3;
  finally
    AProperties.EndUpdate;
  end;
  cxImageComboBox1.EditValue := 0;
end;

VCL Editors Library: A Populated Image Combo Box Editor

Direct TcxImageComboBoxItems Class Reference

The TcxCustomImageComboBoxProperties.Items property references a TcxImageComboBoxItems object.

Inheritance

See Also