在DBGrid中选中其中的一条记录使其改颜色,且只改变这一条记录的颜色,其他的记录不变色.请问用代码怎样实现?谢谢各位了!
解决方案 »
- 关于Record数据求助
- Printer打印到纸张产生的页边距的问题,打印高手帮忙啊!!!
- delphi盒子被挂了网马,大家小心。
- 请问activeX开发高手一个问题
- 怎样把一个字符串如“20050102030405”转换成TDBDateTimeEditEh控件显示出来的值?
- 过程引用自定义变量要加什么 ?小弟向大家求教。
- 今天我从0开始学DELPHI以示庆祝,散分!!!!
- 问两个关于delphi的基础问题
- 如何使程序建立关联后,点击相关联的文件后就后自动打开该文件在我的程序里。
- 一个菜菜的问题 三层架构中所说的执行 MTS Explorer or Component Services 如何执行,我找不到exe?
- 第三方控件的安装方法
- clientdataset分页后数据咋不跟着移动呢?
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
with TDbgrid(sender) do
begin
if gdSelected in State then
begin
dbgrid1.Canvas.Brush.Color:=clyellow; //这行是背景变色
dbgrid1.Canvas.Font.Color:= clRed; //这行代码是字变色
end;
DefaultDrawColumnCell(rect,datacol,column,state);
end;
end;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
with TDbgrid(sender) do
begin
if gdSelected in State then
begin
dbgrid1.Canvas.Brush.Color:=clyellow; //这行是背景变色
dbgrid1.Canvas.Font.Color:= clRed; //这行代码是字变色
end;
//DefaultDrawColumnCell(rect,datacol,column,state);
//应改为
DefaultDrawDataCell(Rect,Column.Field,state);
end;
end;