Delphi2007.net 首页

Delphi 非技术区  |  Delphi VCL组件开发及应用  |  Delphi 数据库相关  |  Delphi Windows SDK/API
Delphi 网络通信/分布式开发  |  Delphi 语言基础/算法/系统设计  |  Delphi GAME,图形处理/多媒体  |  Delphi 笔记

改变listview颜色

作者:lnjamn   关键字:   时间:2005-12-30 4:28:20

<http://www.delphibbs.com/delphibbs/dispq.asp?lid=3274901>

procedure TQueryForm.ListViewCustomDrawItem(Sender: TCustomListView;
  Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
  inherited;
    DefaultDraw:=false;

{  if cdshot in state then
  begin
    ListView.Canvas.Font.Color:=clred;
    ListView.Canvas.Brush.Color:=clblue;
  end; }
  if StrtoFloat(Item.SubItems[4]) < 60 then
        begin
          ListView.Canvas.Brush.Color := RGB(255, 240, 210);
          ListView.Canvas.Font.Color := clBlack;
        end;
    DefaultDraw:=true;
end;