Delphi and Kylix

Moderators: pritaeas
Number of threads: 7264
Number of posts: 19073

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
ListView Controls Posted by Development on 5 Oct 2003 at 1:54 PM
Hello everyone,

Ok I am trying to workout how to add colors to names in a listview and a outline box on the selected names!

like say this is the listview:

Name: 1 is yellow
Name: 2 is red with a box around it

so it not the same color and I can pick the color/boxaround the name on a server.

there no help files on this I look even used copernic to try and find information about it can one of u help me?

I be host gratefull :)

yours
simon
Slewis
Report
Re: ListView Controls Posted by zibadian on 5 Oct 2003 at 7:44 PM
: Hello everyone,
:
: Ok I am trying to workout how to add colors to names in a listview and a outline box on the selected names!
:
: like say this is the listview:
:
: Name: 1 is yellow
: Name: 2 is red with a box around it
:
: so it not the same color and I can pick the color/boxaround the name on a server.
:
: there no help files on this I look even used copernic to try and find information about it can one of u help me?
:
: I be host gratefull :)
:
: yours
: simon
: Slewis
:
Here is a small example code, which will draw the colors based on the ImageIndex of the item.
procedure TForm1.ListView1CustomDrawItem(Sender: TCustomListView;
  Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
  case Item.ImageIndex of
    0: ListView1.Canvas.Font.Color := clYellow;
    1: ListView1.Canvas.Font.Color := clRed;
  end;
  DefaultDraw := true;
end;

The box might prove more difficult.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.