Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Listview Customdrawitem (https://www.delphipraxis.net/122732-listview-customdrawitem.html)

seppi.tm 21. Okt 2008 08:52


Listview Customdrawitem
 
Hallo,

ich habe ein JvListView und habe "on Customdrawitem" das gemacht:

Delphi-Quellcode:
DefaultDraw := True;
if item.SubItems.Strings[4]='ja' then begin
  Sender.Canvas.Brush.Color := clLime;
end
else begin
   Sender.Canvas.Brush.Color := clRed;
end;
ich will wenn dort ja drin steht das die zeile grün wird und wenn was anderes drin steht soll sie rot werden!

das habe ich gefunden aber wie rufe ich das auf?

soulies 21. Okt 2008 10:53

Re: Listview Customdrawitem
 
hoi,

'CustomDrawItem' wird automatisch aufgerufen wenn du einen
neuen Eintrag der Liste hinzufügst.

Delphi-Quellcode:
 
item.SubItems.Strings[4]='ja'
bedeutet ja du hast dein caption und 5 Unterelemente - wolltest du das auch so ?

cya

seppi.tm 21. Okt 2008 11:01

Re: Listview Customdrawitem
 
ja das wollte ich so ;-)

edit://
DAs geht aber trotzdem nicht was mache ich falsch?

seppi.tm 21. Okt 2008 11:17

Re: Listview Customdrawitem
 
Jetzt gehts habe es statt auf item auf subitem gemacht ^^ ;-) danke für die hilfe


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:07 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz