Thema: Delphi TListView.OnDrawItem

Einzelnen Beitrag anzeigen

WojTec

Registriert seit: 17. Mai 2007
482 Beiträge
 
Delphi XE6 Professional
 
#3

Re: TListView.OnDrawItem

  Alt 15. Nov 2010, 20:42
Oh, why I didn't think about this

Delphi-Quellcode:
begin
  with lvRecentFiles, lvRecentFiles.Canvas do
  begin
    if FileExists(Item.Caption) then
      Font.Color := clBlack
    else
      Font.Color := clGrayText
    ;

    //TextOut(Rect.Left + 2, Rect.Top + 2, Item.Caption);

    R := Classes.Rect(Rect.Left + 6, Rect.Top + 3, Rect.Right, Rect.Bottom - 2);
    S := Item.Caption;
    TextRect(R, S, [tfEndEllipsis]);
  end;
end;
There is grey, but can't be selected as when OwnerDraw is False (in system style). In Delphi can be. Any idea?
  Mit Zitat antworten Zitat