ListView Controls - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

ListView Controls

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

Comments

  • zibadianzibadian Posts: 6,349Member
    : 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.
    [code]
    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;
    [/code]
    The box might prove more difficult.
Sign In or Register to comment.