TcxImageComboBoxItems.Add Method
Creates a new image combo box item and adds it to the end of the collection.
#Declaration
Delphi
function Add: TcxImageComboBoxItem;
#Returns
Type | Description |
---|---|
Tcx |
The created image combo box item. |
#Remarks
Call the Add
function to create image combo box items. Created items are accessible by index through the Items property.
#Code Example: Create and Configure Image Combo Box Items
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;
See Also