vcl-cximagecombobox-3619fcf7.md
A collection of image combo box items.
TcxImageComboBoxItems = class(
TOwnedCollection
)
TcxImageComboBox and TcxDBImageComboBox editors use a TcxImageComboBoxItems collection to manage items available for selection.
The list below outlines key members of the TcxImageComboBoxItems class. These members allow you to manage image combo box items.
AddCreates a new image combo box item and adds it to the end of the collection.ClearClears the collection.CountReturns the number of stored image combo box items.DeleteAllows you to delete individual image combo box items.ItemsProvides indexed access to stored image combo box items.
AssignCopies items between image combo box item collections.BeginUpdate | EndUpdateAllow you to avoid excessive redraw operations during batch collection changes.
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;
TcxImageComboBoxItem *AItem;
TcxImageComboBoxProperties *AProperties;
// ...
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();
}
__finally
{
AProperties->EndUpdate();
}
cxImageComboBox1->EditValue = 0;
The TcxCustomImageComboBoxProperties.Items property references a TcxImageComboBoxItems object.
TObject TPersistent TCollection TOwnedCollection TcxImageComboBoxItems
See Also