控制ListView每行的背景色

字体大小: 中小 标准 ->行高大小: 标准
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;

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/68154.html