突出显示dbgrid中的某一条记录 如何在用鼠标点选dbgrid中的某一行时该行显示某种颜色,点选另外一行时该也显示另外一种颜色,但刚才那行颜色恢复? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 procedure Tclwhf.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState); var C1, C2: TColor; begin if gdSelected in State then begin with TDBGrid(Sender).Canvas do begin C1 := Brush.Color; C2 := Font.Color; Brush.Color := ClRed;//红底 Font.Color := Clyellow;//黄字 TDBGrid(Sender).DefaultDrawColumnCell(Rect, DataCol, Column, State); Brush.Color := C1; Font.Color := C2 ; end; end; end;这个是红底黄字1~ procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState);begin if DataSource1.DataSet.FieldByName('id').AsInteger mod 2 = 0 then DBGrid1.Canvas.Brush.Color := clred else DBGrid1.Canvas.Brush.Color := clYellow; DBGrid1.DefaultDrawColumnCell(rect,datacol,column,state);end; 就是选择一整行阿你把DBgrid的options里面dgediting选中就可以了 借贵弟一用!谢谢DBGrid高手请帮帮我呀!http://community.csdn.net/Expert/topic/5377/5377515.xml?temp=.7863123 其实我的用意是这样的!向数据库更改完数据之后,按“提交”按钮,然后要在dbgrid中高亮显示我刚才修改过的那条记录! 使用Parameters.ParamByName方法时 如何获取sql.text值 求高手指点 用ado导出数据为excel文件用什么方法比较好? 如何让DBGrid前面有黑色三角指针的行的某一单元格被选中? 公司的面试题目 小弟初次提问,望高手多多指点? 遇到了好心人,请wizardqi进来接分 如何显示数据库中的数据?? 求救:对于VB中的AscW()在DELPHI中是否有同样的函数???? 如何自动登录数据库,我查了以前的帖子,还是不行 大哥们,进来看看!纸张方向问题,用FastReport 3.0套打票据(自定义纸张)。 dephi开发三层结构的管理软件,如何设置应用服务器的端口?
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var
C1, C2: TColor;
begin
if gdSelected in State then
begin
with TDBGrid(Sender).Canvas do
begin
C1 := Brush.Color;
C2 := Font.Color; Brush.Color := ClRed;//红底
Font.Color := Clyellow;//黄字 TDBGrid(Sender).DefaultDrawColumnCell(Rect, DataCol, Column, State);
Brush.Color := C1;
Font.Color := C2 ;
end;
end; end;
这个是红底黄字1~
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
if DataSource1.DataSet.FieldByName('id').AsInteger mod 2 = 0 then
DBGrid1.Canvas.Brush.Color := clred
else
DBGrid1.Canvas.Brush.Color := clYellow;
DBGrid1.DefaultDrawColumnCell(rect,datacol,column,state);
end;
你把DBgrid的options里面dgediting选中就可以了
DBGrid高手请帮帮我呀!
http://community.csdn.net/Expert/topic/5377/5377515.xml?temp=.7863123
向数据库更改完数据之后,按“提交”按钮,然后要在dbgrid中高亮显示我刚才修改过的那条记录!