首页  编辑  

create colored rows in a TListView?

Tags: /超级猛料/VCL/ListView/   Date Created:

create colored rows in a TListView?

procedure TForm1.ListView1CustomDrawItem(Sender: TCustomListView;

 Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);

begin

 with ListView1.Canvas.Brush do

 begin

   case Item.Index of

     0: Color := clYellow;

     1: Color := clGreen;

     2: Color := clRed;

   end;

 end;

end;

img_30975.bmp (198.1KB)