发信人: kss()
整理人: huxley(2001-12-17 20:13:49), 站内信件
|
【 在 nosound (无声) 的大作中提到: 】
: 【 在 kss (寇少衰) 的大作中提到: 】
: 好象不要这么复杂吧?
: 我记得只在OnDrawCell中加入;
: Canvas.Font.Color := clTeal;
: .......
呵呵,是我搞错了,应该是在OnDrawDataCell中
调用的函数是DefaultDrawDataCell;
例如:
procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRec t;
Field: TField; State: TGridDrawState);
begin
if Table1.FieldByName('Salary').AsFloat > 30000 then
DBGrid1.Canvas.Font.Color := clRed;
DBGrid1.DefaultDrawDataCell(Rect, Field, State);
end;
另外,也可以在OnDrawColumnCell中编写,不过相应的函数改为DefaultDrawCol umnCell。
-- OO
OO @@ 唯 故
OO@@ 能 能
@@\\ 極 極
@@ \\\ 於 於
\\\ 情 劒
※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 202.103.116.221]
|
|