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

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.