Ist es das was du suchst?
Delphi-Quellcode:
//markierter Eintrag in ListBox in eigener Farbe
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
with (Control as TListbox) do
begin
if odSelected in State then
Canvas.Brush.Color := $00C08000;
Canvas.FillRect(Rect);
Canvas.TextOut(Rect.Left+5, Rect.Top, Items[Index]);
end;
end;
Gruß Tino