{Listbox1.Style := lbOwnerDrawFixed}
Delphi-Quellcode:
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
with TListbox(Control) do
begin
if odSelected in State then
begin
Canvas.Brush.Color := Color;
Canvas.Font.Color := Font.Color;
end;
Canvas.FillRect(Rect);
Rect.Left := Rect.Left + 2;
DrawText(Canvas.Handle,
PChar(Items[Index]),
-1,
Rect,
DT_SINGLELINE or DT_VCENTER);
end;
end;
Falls du den Focus Rahmen noch wegbringen möchtest, wird's wohl komplizierter...