TcxImageComboBoxItem Class
An image combo box item.
Declaration
TcxImageComboBoxItem = class(
TCollectionItem
)
Remarks
Like in a simple combo box, a selected image combo box item is associated with an edit value. In addition, image combo box items can display images and corresponding descriptions.
Main API Members
The list below outlines key members of the TcxImageComboBoxItem
class. These members allow you to configure image combo box items.
- Collection
Provides access to the parent collection.
Tip
You need to cast the property value to the TcxImageComboBoxItems class to access all public API members.
- Description | ImageIndex
- Specify the item’s description and image.
- Index
- Specifies the item’s index in the parent collection.
- Tag
- Allows you to associate the image combo box item with an integer value (a pointer, for example).
- Value
Specifies the edit value associated with the image combo box item.
Note
Make sure that all items in the same image combo box editor have unique Value property values. If an image combo box has two or more items with identical values, the editor can display only the first item when one of them is selected.
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;
Direct TcxImageComboBoxItem Class References
The following public API members reference a TcxImageComboBoxItem
object:
- TcxImageComboBoxItems.Add
- Creates a new image combo box item and adds it to the end of the collection.
- TcxImageComboBoxItems.Items
- Provides indexed access to image combo box items.