Delphi(程序人生)

Delphi Programer DoubleCat

导航

dbgrid中根据任一条件某一格变色

procedure TForm_main.DBGridEh1DrawColumnCell(Sender: TObject;

    const Rect: TRect; DataCol: Integer; Column: TColumnEh;

    State: TGridDrawState);

    begin

      if (trim(DataModule1.ADOQuery1.FieldByName('dczt').AsString)='OK') then

      begin

        if datacol=6 then

        begin

          DbGrideh1.Canvas.Brush.Color:=clGradientActiveCaption;

          DbGrideh1.DefaultDrawColumnCell(Rect,datacol,column,state);

        end;

      end;

    end;

posted on 2008-06-14 17:16  DoubleCat  阅读(371)  评论(0编辑  收藏  举报