Howdy, Stranger!

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

Categories

ListView color control

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 boxaround it

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

  • injektiloinjektilo Member Posts: 113
    use following code in the CustomDrawItem

    [code]
    procedure TForm1.ListView1CustomDrawItem(Sender: TCustomListView;
    Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
    begin
    Sender.Canvas.Brush.Color := clRed;
    Sender.Canvas.Font.Color := clGreen;
    Sender.Canvas.TextOut(Item.Position.X, Item.Position.Y, 'Tom');
    end;
    [/code]
Sign In or Register to comment.