如何使得DBGrid1中某一个字段中的符合条件的内容为红色,不符合条件的为蓝色?在先给分... 使得DBGrid1中某一个字段中的符合条件的内容为红色,不符合条件的为蓝色?在先给分... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin if Table1.FieldByName('size').AsInteger >=40 then begin DBGrid1.Canvas.Font.Color := clRed; DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State); end elseDBGrid1.Canvas.Font.Color := clblue; DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State); end;end; procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); begin if DataCol=1 then //第一列if Table1.FieldByName('size').AsInteger >=40 then begin DBGrid1.Canvas.Font.Color := clRed; DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State); end elseDBGrid1.Canvas.Font.Color := clblue; DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State); end;end; 0分帖子~~~ WebBrowser中比较棘手的问题(自动登录),请各位指点,一定高分 *******如何控制QQ的动行?****** 想给button两个caption,该怎么做啊? 那一种打印控件比较好? 获取数据表 用过神龙卡BUFFER开发VOD系统的人请进! 枚举中的 枚举值能是 1,2,3吗?我想判断 某个月是不是在(4,6,9,11)这个只有30天的月份??????谢谢各位大侠出手!!!! 救命啊!救命啊!高价购买‘Tab’键的十进位值(50分) 我是菜鸟,可是我又各自己无法解决的问题.请帮帮我! 问一个关于ADO的问题,急 一个简单问题:关于字符串的替换,在线等待回复
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if Table1.FieldByName('size').AsInteger >=40 then
begin
DBGrid1.Canvas.Font.Color := clRed;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end else
DBGrid1.Canvas.Font.Color := clblue;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
end;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if DataCol=1 then //第一列
if Table1.FieldByName('size').AsInteger >=40 then
begin
DBGrid1.Canvas.Font.Color := clRed;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end else
DBGrid1.Canvas.Font.Color := clblue;
DBGrid1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
end;