这一段怎么样?
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect:TRect;DataCol: Integer; Column: TColumn; State: TGridDrawState);beginif Table1.FieldByName('成绩').AsInteger<60 thenDBGrid1.Canvas.Font.Color := clRed;DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);end;
procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect:TRect;DataCol: Integer; Column: TColumn; State: TGridDrawState);beginif Table1.FieldByName('成绩').AsInteger<60 thenDBGrid1.Canvas.Font.Color := clRed;DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);end;
procedure TXT_XinXi_Form.WuZiDBGridDrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
if column.Grid.Fields[X].Value < 60 then
wuzidbgrid.Canvas.Font.Color := clred;
wuzidbgrid.DefaultDrawColumnCell(rect, datacol, column, state);
end;
他们都有OnGetCellParam,在其中判断就行了,非常方便,痛快。在那过程中
可以设字体,颜色,什么都行。
去康炜那儿下一个吧。EHLIB是最好的DBGRID控件。
http://www.jd365.net/kangwei/
user:cch_b
pass:dcvvcd
他们都有OnGetCellParam,在其中判断就行了,非常方便,痛快。在那过程中
可以设字体,颜色,什么都行。
去康炜那儿下一个吧。EHLIB是最好的DBGRID控件。
http://www.jd365.net/kangwei/
user:cch_b
pass:dcvvcd