您的位置:首页 > 其它

如何让Listview(vsReport)选中的一行字体变色或底色改变

2008-07-22 15:29 351 查看

如何让Listview(vsReport)选中的一行字体变色或底色改变?

把属性HideSelection设为false就可以得到你的想要的效果!

奇偶颜色不同
procedure TForm1.ListView1CustomDrawItem(Sender: TCustomListView;
Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
if odd(item.Index) then //奇偶判断
//if item.Index = ListView1.ItemIndex then
item.ListView.Canvas.Brush.Color := RGB(150, 150, 150)
else
item.ListView.Canvas.Brush.Color := RGB(200, 200, 200);
end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: