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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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
rwilson032697Commented:
This is in D4, so it may not be available to you...

Raymond.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

de_epAuthor Commented:
so i reject your answer ok ??

thanks
de_ep
0
MadshiCommented:
Download the free component TExtListView from here:

http://www.delphifreestuff.com/

There are demos, too.

Regards, Madshi.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
de_epAuthor Commented:
well thanks
de_ep
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Fonts Typography

From novice to tech pro — start learning today.