List View with Font Color ...

hi experts !
i got problem now, i wanna make the ListView component, each item can have their own text color, so there can be several text color in one list view. are there any suggestion which part of TCustomListView i can add or edit so i can make a new ListView component which have the ability to show diffrent text color ??

thanx
:Þ de_ep
de_epAsked:
Who is Participating?
 
MadshiConnect With a Mentor Commented:
Download the free component TExtListView from here:

http://www.delphifreestuff.com/

There are demos, too.

Regards, Madshi.
0
 
rwilson032697Commented:
Use a the OnCustomDrawItem event to change the colour, something like this:

procedure TForm1.ListView1CustomDrawItem(Sender: TCustomListView;
  Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
 DefaultDraw := True;
 if item.caption = 'Fred' then
   ListView1.Canvas.Font.color := clgreen
 else
   ListView1.Canvas.Font.color := clred;
end;

This will make an item 'Fred' green, everything else red. Of course you cn use whatever rule you need to change the colour...

Cheers,

Raymond.
0
 
de_epAuthor Commented:
i've checked the source of TCustomListView, and i couldn't find OnCustomDrawItem event ... by the way for your information i'm using delphi 3.02.
well any suggestion ??

rgds,
de_ep
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
rwilson032697Commented:
This is in D4, so it may not be available to you...

Raymond.
0
 
de_epAuthor Commented:
so i reject your answer ok ??

thanks
de_ep
0
 
de_epAuthor Commented:
well thanks
de_ep
0
All Courses

From novice to tech pro — start learning today.