2,497
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
Field: TField; State: TGridDrawState);
begin
if Table1.FieldByName( 'Salary ').AsInteger > 30000 then begin
//字体
DBGrid1.Canvas.Font.Color := clRed;//字体色
//背景
DBGrid1.Canvas.Brush.Color := clBlue;//背景色
DBGrid1.Canvas.FillRect(Rect);
end;
DBGrid1.DefaultDrawDataCell(Rect, Field, State);
end;