如上图,代码类似下面:注意,ListView的OwnerDraw应该设置为False!
然后在CustDrawItem中,添加代码:
if Item.Index mod 2 =0 then
Sender.Canvas.Brush.Color :=clSkyBlue
else
Sender.Canvas.Brush.Color :=clWhite;