Hi,
yes, you have to draw all items in the OwnerDraw Event.
Activate OwnerDraw by Style := csOwnerDrawVariable;
That's a Sample from doing this with a Combobox (Flaggen is TImagelist):
procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: integer;
ARect: TRect; State: TOwnerDrawState);
var
ComboBox: TComboBox;
symBitmap: TBitmap;
begin
ComboBox := (Control as TComboBox);
symBitmap := TBitmap.Create;
try
Flaggen.GetBitmap(index, symBitmap);
with ComboBox.Canvas do
begin
ARect := Bounds(ARect.Left + 10, Arect.Top + 2, Arect.Left + 26, Arect.Top + 13);
FillRect(ARect);
if symBitmap.Handle <> 0 then
Draw(ARect.Left, ARect.Top, symBitmap);
end;
finally
symBitmap.Free;
end;
end;
best, Michael