Thema: Delphi ListBox formatieren

Einzelnen Beitrag anzeigen

.chicken

Registriert seit: 5. Dez 2006
459 Beiträge
 
#3

Re: ListBox formatieren

  Alt 14. Mai 2007, 17:19
Ja, also im OnDawItem Event oder?
Da formatiere ich ja auch meine Schrift, aber ich weiss nicht wie ich da verhindern soll, dass angewählte Items markiert sind.

Hier mal mein Code wie ich die Schrift formatiere:
Delphi-Quellcode:
procedure TListForm.UserListDrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
begin
  with UserList do
  begin
    Canvas.Font.Color := (Items.Objects[Index] as TListObject).Color;
    Canvas.FillRect(Rect);
    Canvas.TextOut(Rect.Left + 2, Rect.Top, Items.Strings[Index]);
  end;
end;
  Mit Zitat antworten Zitat