烂
烂泥
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TFrm_cl.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
dbgrid1.Canvas .FillRect (rect);
if (column.Field =query1jc) and (query1jc.Asinteger<0) then
dbgrid1.Canvas .font.color:=CLred;
if (column.Field =query1jc) and (query1jc.Asinteger>0)then
dbgrid1.Canvas .font.color:=CLBlue;
if (column.Field =query1jc) and (query1jc.Asinteger=0) then
dbgrid1.Canvas .font.color:=Clgreen;
dbgrid1.Canvas .textrect(Rect,REct.left,Rect.Top,column.Field .displaytext);
end;
如上代码以后,Dngrid中所有的字段都开始左对齐,太难看。
有办法解决麽?
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
dbgrid1.Canvas .FillRect (rect);
if (column.Field =query1jc) and (query1jc.Asinteger<0) then
dbgrid1.Canvas .font.color:=CLred;
if (column.Field =query1jc) and (query1jc.Asinteger>0)then
dbgrid1.Canvas .font.color:=CLBlue;
if (column.Field =query1jc) and (query1jc.Asinteger=0) then
dbgrid1.Canvas .font.color:=Clgreen;
dbgrid1.Canvas .textrect(Rect,REct.left,Rect.Top,column.Field .displaytext);
end;
如上代码以后,Dngrid中所有的字段都开始左对齐,太难看。
有办法解决麽?