DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: qiaoguoqiang
今日帖子: 14
在线用户: 10
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
男 lsx1982 (prince_lsx) ★☆☆☆☆ -
盒子活跃会员
2004/3/8 10:16:07
标题:
召集各大高手!关于dbgrid的行的颜色问题! 浏览:1939
加入我的收藏
楼主: 例:if status=1 then  dbgrid的一行记录行变色!
请高手如何实现???

----------------------------------------------
I love the game!
作者:
男 lsx1982 (prince_lsx) ★☆☆☆☆ -
盒子活跃会员
2004/3/8 10:44:02
1楼: 帮帮啊!等着交货!!
----------------------------------------------
I love the game!
作者:
男 waterstone (waterstone) ★☆☆☆☆ -
盒子活跃会员
2004/3/8 10:55:53
2楼:
http://bbs.2ccc.com/topic.asp?topicid=57041
此帖子包含附件:
JPEG 图像
大小:30.3K
----------------------------------------------
我来自农村广阔的田野我的每一个动作都很夸张http://waterstone.51r.com
作者:
男 waterstone (waterstone) ★☆☆☆☆ -
盒子活跃会员
2004/3/8 11:00:07
3楼: 斑竹花费心血做的强大功能怎么不用啊
此帖子包含附件:
JPEG 图像
大小:65.7K
----------------------------------------------
我来自农村广阔的田野我的每一个动作都很夸张http://waterstone.51r.com
作者:
男 yangshuo (海豚) ★☆☆☆☆ -
盒子活跃会员
2004/3/8 11:06:06
2楼: 你的问题问的很好,不过,这样的技术现在开发人员基本不在自己动手开发了,多数使用一些商业的或者免费的grid组件来完成了,不过,我还是花了2分钟的时间给你写了一个例子,使用的是delphi6标准的dbgrid组件.我用的是bde的table,连接的是dbdemos下的animams.dbf数据库,窗体上有一个dbgrid,在dbgird的ondrawdatacell事件,加入了如下的代码:
procedure TForm1.DBGrid1DrawDataCell(Sender: TObject; const Rect: TRect;
  Field: TField; State: TGridDrawState);
begin
  with (Sender as TDBGrid).Canvas do begin
    if Table1.FieldByName('size').asInteger >10 then begin
      Brush.Color := clRed;
    end else begin
      Brush.Color := clWhite;
    end;
    FillRect(Rect);
    if Field.DataType = ftTypedBinary then Exit;
    TextOut(Rect.Left,Rect.Top,Field.AsString);
    if gdSelected in State then begin
      Brush.Color := clBlue;
      FillRect(Rect);
      Font.Color := clWhite;
      TextOut(Rect.Left,Rect.Top,Field.AsString);
    end;
    if gdFocused in State then begin
      Brush.Color := clBlue;
      FillRect(Rect);
      Font.Color := clWhite;
      TextOut(Rect.Left,Rect.Top,Field.AsString);
    end
  end;
end;
你看一看.
杨硕--delphi的忠实拥戴者
yangshuo@263.net
----------------------------------------------
delphi的忠实拥戴者
一起交流DELPHI
MSN: tech@delphisoft.com.cn
作者:
男 lsx1982 (prince_lsx) ★☆☆☆☆ -
盒子活跃会员
2004/3/8 11:15:08
4楼: 谢谢楼上两位!
请问field是什么?编译时出错啊!
textout又是什么?
急急!!!
----------------------------------------------
I love the game!
作者:
男 lsx1982 (prince_lsx) ★☆☆☆☆ -
盒子活跃会员
2004/3/8 11:45:53
5楼: 再求!!
----------------------------------------------
I love the game!
作者:
男 waterstone (waterstone) ★☆☆☆☆ -
盒子活跃会员
2004/3/8 11:58:40
6楼: 口口口口口此处因头晕略去 5 万字!

----------------------------------------------
我来自农村广阔的田野我的每一个动作都很夸张http://waterstone.51r.com
作者:
男 lsx1982 (prince_lsx) ★☆☆☆☆ -
盒子活跃会员
2004/3/8 12:31:36
7楼: 编译会发生错误的!!!
怎么办?
----------------------------------------------
I love the game!
作者:
男 mkz (mkz) ★☆☆☆☆ -
盒子活跃会员
2004/3/8 12:39:59
8楼: to lsx1982
建议先学习delphi基础知识
----------------------------------------------
-
作者:
男 lsx1982 (prince_lsx) ★☆☆☆☆ -
盒子活跃会员
2004/3/8 13:40:51
9楼: 谢谢你好意
可是我现在在做项目!
只是遇到点难题而已,谢谢高手的指点!刚才问题已解决!
----------------------------------------------
I love the game!
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行93.75毫秒 RSS