在oncoulmncell事件里控制 if dm.q_lingsh.fieldbyname('cx').asboolean=true then
dbgrid1.canvas.font.color:=clred;
dbgrid1.canvas.font.color:=clred;
解决方案 »
- 环境DC句柄 与 Canvas画布
- 还有人记得Turbo Delphi那个东西吗?我的怎么过期了
- 怎么给图片加水印(或图片合成)
- fastreport 多列报表问题
- delphi 能不能返回 sql server 里的消息 例如做了个修改 update ,sql server 消息框里提示 (所影响的行数为 8756 行)
- 请帮帮忙!
- 一个很偏但很有用的函数,近来看看吧!
- 如何在dbgrid中多行选择后使它变成另外一种颜色?高分相送!
- (︶︿︶) 300分 求一份设计文档! (︶︿︶)
- 疯狂的QuickReport,谁碰到过?帮帮我!(附源码重发)
- 那里有DELPHI常见书籍下载啊
- 小弟最近用IDSMTP控件时发现的莫名其妙!
DefaultDrawDataCell(Rect, Field, State);
Field: TField; State: TGridDrawState);
begin
if Table1.FieldByName('Salary').AsInteger > 30000 then begin
//字体
DBGrid1.Canvas.Font.Color := clRed;//字体色
//背景
DBGrid1.Canvas.Brush.Color := clBlue;//背景色
DBGrid1.Canvas.FillRect(Rect);
end;
DBGrid1.DefaultDrawDataCell(Rect, Field, State);
end;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
Value:String;
begin
if ADOTable1.FieldByName('qty').AsInteger>10 then
begin
Value:=ADOTable1.FieldByName('qty').AsString ;
DBGrid1.Canvas.Font.Color := clRed;
DBGrid1.Canvas.Brush.Color :=clBlue;
DBGrid1.Canvas.Pen.Color :=clBlue;
DBGrid1.Canvas.FillRect(Rect);
DBGrid1.DefaultDrawDataCell(Rect,
ADOTable1.FieldByName('qty'), State);
end;end;