AdvSmoothListBox item background colour delphi

Hello,

I would like to change the background colour of Items in an AdvSmoothListBox depending on the itemindex. I'm not succeeding at the moment and tried different things. Like using the Itemdraw, but I can't get the right result. Can somebody help me?
I use Delphi 10.3.

A small example would be very helpfull.

Thanks in advance!

Marcel

Hello,

You can use the OnItemCustomizeFill event.

unit
  GDIPFill;

procedure TForm2.AdvSmoothListBox1ItemCustomizeFill(Sender: TObject;
  Item: TAdvSmoothListBoxItem; AFill, ADisabledFill, ASelectedFill: TGDIPFill);
begin
  if (Item.Index mod 2 = 0) then
  begin
    AFill.Color := clRed;
  end;
end;

Ah, as easy as that... :slight_smile: Thank you! That works for me!