procedure TfmInfo.dgInfoDrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if ADODataSet1.FieldByName('库存').AsInteger = 0 then
begin
with dgInfo do
begin
Canvas.Brush.Color:=clYellow; //设置背景色
Canvas.Font.Color:=clRed; //设置字体颜色
Canvas.fillrect(Rect);
DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;
end;
end;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if ADODataSet1.FieldByName('库存').AsInteger = 0 then
begin
with dgInfo do
begin
Canvas.Brush.Color:=clYellow; //设置背景色
Canvas.Font.Color:=clRed; //设置字体颜色
Canvas.fillrect(Rect);
DefaultDrawColumnCell(Rect,DataCol,Column,State);
end;
end;
end;