![]() |
AW: TListView.OnDrawItem
One thing I immediately spotted:
Delphi-Quellcode:
has to be
procedure TForm20.FormCreate(Sender: TObject);
begin SetWindowTheme(lvRecentFiles.Handle, 'Explorer', nil); Theme := OpenThemeData(0, 'ListView'); end;
Delphi-Quellcode:
Because, as I said, you have to manually activate the "explorer style" for each window by calling SetWindowTheme. If you do this for a specific window, but then open the theme data of a different window handle (0), of course it won't work.
procedure TForm20.FormCreate(Sender: TObject);
begin SetWindowTheme(lvRecentFiles.Handle, 'Explorer', nil); Theme := OpenThemeData(lvRecentFiles.Handle, 'ListView'); end; Not saying, that this is the only issue (might be, might not be), but at least it's one reason why it can't work. If it doesn't work after changing this, try to set
Delphi-Quellcode:
to
DefaultDraw
Delphi-Quellcode:
because it's possible that the default drawing routine overdraws the background again (I don't know about that and I'm too lazy to look it up in the VCL sources).
False
Also, I don't know what the difference between
Delphi-Quellcode:
and
OnDrawItem
Delphi-Quellcode:
is, and in which order they are called. But I would suggest moving the
OnCustomDrawItem
Delphi-Quellcode:
-code to the
DrawThemedBackground
Delphi-Quellcode:
routine.
OnDrawItem
|
Re: AW: TListView.OnDrawItem
Now working :D Thanks so much!
Delphi-Quellcode:
Yes, OnCustom* are not required, just OnDrawItem is needed. This cod I putten between font color and text render. And now I have list liki in Delphi :D
Brush.Style := bsClear;
FillRect(Rect); if odSelected in State then begin DrawThemeBackground(Theme, lvRecentFiles.Canvas.Handle, LVP_LISTITEM, LIS_SELECTED, Rect, nil ); end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:54 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz