J
jsn
Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下
procedure Tpdpdnewf.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
Field: TField; State: TGridDrawState);
begin
with dm.pd_hqry do begin
if fieldbyname('overquan').asinteger<=fieldbyname('quan').asinteger then
DBGrid1.Canvas.Font.Color := clRed;
DBGrid1.DefaultDrawDataCell(Rect,dm.pd2_h_qryhh,state);
end;
end;
刚开始是可以变色的,但是dbgrid里的四列的数据都变得相同,
如a,a,a,a; b,b,b,b;
但现在连色都不变了,(里面的数据有满足条件的。),请指教。
procedure Tpdpdnewf.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
Field: TField; State: TGridDrawState);
begin
with dm.pd_hqry do begin
if fieldbyname('overquan').asinteger<=fieldbyname('quan').asinteger then
DBGrid1.Canvas.Font.Color := clRed;
DBGrid1.DefaultDrawDataCell(Rect,dm.pd2_h_qryhh,state);
end;
end;
刚开始是可以变色的,但是dbgrid里的四列的数据都变得相同,
如a,a,a,a; b,b,b,b;
但现在连色都不变了,(里面的数据有满足条件的。),请指教。