想要dbgrid能够随着数据项的变化来改变颜色,比如数据项是空的,显示蓝色,不空显示红色的,
解决方案 »
- sendmessage创建目标程序中已有的窗体
- dbexpress 中连sybase没有connectionstring?
- dll封装的窗体中,speedbutton按钮在光标离开的时候,不沉下去。
- 求做报表的源代码
- 关于string类型到datetime类型的转换问题??急用
- 关于Wise9.0如何设置BDE的
- 怎么我把DBEDITEH的READONLY设为TRUE后,还不是只读属性啊?
- 如何屏蔽Ctrl+AltDel?100分只给一个人!
- 怎样将当前时间转换成一个长整型的数值
- Delphi接收外部参数
- 分很少,但问题很有挑战性?我贴了久没有可行的办法!!!太难了
- 在关闭程序后为什么在内存中还存在?
procedure TForm1.BGrid1DrawColumnCell(Sender: TObject;
const Rect: TRect; DataCol: Integer; Column: TColumn;
State: TGridDrawState);
begin
with DBgrid1 do
begin
if datasource.dataset.fieldbyname('字段').asboolean=true then//条件可以自己设定
begin
canvas.font.color:=clblue;
DefaultDrawColumnCell(rect,datacol,column,state);
end
end;
end;