Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxImageComboBoxItem.ImageIndex Property

Specifies the index in image lists associated with the parent image combo box editor.

#Declaration

Delphi
property ImageIndex: TcxImageIndex read; write; default -1;

#Property Value

Type Description
TcxImageIndex

The index of the displayed image in a source image list.

If the property value is -1, the image combo box item displays no image.

#Remarks

Use Description and ImageIndex properties to display a description and an image in the image combo box item.

VCL Editors Library: An Image Combo Box Item

The ImageIndex property specifies the index in image lists assigned to the parent image combo box editor’s Properties.Images and Properties.LargeImages properties.

#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;

VCL Editors Library: A Populated Image Combo Box Editor

#Default Value

The ImageIndex property’s default value is -1.

The default ImageIndex property value indicates that the image combo box item displays no image.

See Also