: 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.