Thema: Delphi TListView.OnDrawItem

Einzelnen Beitrag anzeigen

WojTec

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

TListView.OnDrawItem

  Alt 15. Nov 2010, 20:22
Delphi-Version: 2010
I wanted make list with recent files. I also wanted make grey these items, that match file not exists (click File-->Reopen-->Properties in Delphi to see what I want to do). This is what I have:

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

    TextOut(Rect.Left + 2, Rect.Top + 2, Item.Caption);
  end;
end;
I want just grey text if file not exists. Any help with this?

Geändert von WojTec (15. Nov 2010 um 20:24 Uhr)
  Mit Zitat antworten Zitat