H
hswang
Unregistered / Unconfirmed
GUEST, unregistred user!
如何执行的话,当点到符合条件的行时,它才变色,变色后如果滑动滚动条,那么其它不符合条件的行,也都变色了,该怎么处理呢?在线等待,哪位知道请尽快相告,非常感谢!
我用的是dxdbgrid,不是dbgrid,就是当条件符合的时候,全部都变成这种颜色,为什么?
procedure TFrm_main.dxDBGrid1CustomDrawCell(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean;
var AText: String; var AColor: TColor; AFont: TFont;
var AAlignment: TAlignment; var ADone: Boolean);
begin
if data_main.aq_install_move.FieldByName('compelete_time').IsNull and ((now-data_main.aq_install_move.FieldByName('recieve_time').AsDateTime)*24>install_limit_day1) then
AFont.Color:=install_limit_day1_color;
end;
我用的是dxdbgrid,不是dbgrid,就是当条件符合的时候,全部都变成这种颜色,为什么?
procedure TFrm_main.dxDBGrid1CustomDrawCell(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean;
var AText: String; var AColor: TColor; AFont: TFont;
var AAlignment: TAlignment; var ADone: Boolean);
begin
if data_main.aq_install_move.FieldByName('compelete_time').IsNull and ((now-data_main.aq_install_move.FieldByName('recieve_time').AsDateTime)*24>install_limit_day1) then
AFont.Color:=install_limit_day1_color;
end;