![]() |
Re: ListView Columns und OwnerDraw
Ich habe PBExListview weiterentwickelt:
Delphi-Quellcode:
Setzt man allerdings die Komponente auf die Form, tut sich nichts. Warum ?
private
FColumnBrushColor : TColor; [...] protected procedure WMDrawItem(var Message : TWMDrawItem); message WM_DRAWITEM; [...] published property ColumnBrushColor : TColor read FColumnBrushColor write FColumnBrushColor; [...] [...] procedure TColumnListView.WMDrawItem(var Message : TWMDrawItem); var State : TOwnerDrawState; SaveIndex : Integer; begin with Message.DrawItemStruct^ do begin State := TOwnerDrawState(WordRec(LongRec(itemState).Lo)); SaveIndex := SaveDC(hDC); FCanvas.Handle := hDC; FCanvas.Font := Font; FCanvas.Brush.Color := FColumnBrushColor; if itemID = DWORD(-1) then FCanvas.FillRect(rcItem) else DrawItem(Items[itemID], rcItem, State); FCanvas.Handle := 0; RestoreDC(hDC, SaveIndex); end; Message.Result := 1; end; |
Alle Zeitangaben in WEZ +1. Es ist jetzt 08:33 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