Skip to main content

TdxBarImageCombo.Items, TdxBarImageCombo.ImageIndexes, TdxBarImageCombo.Sorted Example

This example demonstrates how to add a new item to a TdxBarImageCombo dropdown list, and associate an image with this item. This example requires a TdxBarImageCombo and TButton objects.

procedure TForm1.Button1Click(Sender: TObject);
var
  IsSorted : Boolean;
begin
  with dxBarImageCombo1 do
  begin
    IsSorted := Sorted;
    if Sorted then Sorted := False;
    Items.Add('New item text');
    ImageIndexes[Items.Count-1] := 0;
    Sorted := IsSorted;
  end;
end;

Use the Exchange method to swap items in the list. This method exchanges both the text strings and images of items.

The following code swaps the first and second list items.

dxBarImageCombo1.Items.Exchange(0,1);