注册 | 登录
收藏 | 帮助
热门文章
编辑推荐
相关文章  
从Melissa到Zotob:Windows蠕虫1
从后台得到webshell技巧大汇总
Qmail邮件系统下防止滥用mail re
Qmail邮件系统下防止滥用mail re
使用telnet 方式连接Imail的SMTP
MDeamon Server 邮件系统迁移完全
用RelayFax搭建传真服务器
Qmail邮件系统下防止滥用mail re
隐藏qmail的SMTP help信息保护你
Sendmail的relay用法汇总
您现在的位置: 顶尖设计 >> IT学院 >> 编程开发 >> Delphi >> 文章正文
在DElphi中的DataGrid怎样使它显示的行间隔改变颜色
作者:looyo  来源:csdn  点击:  更新:2006-12-19
简介:
在DElphi中的DataGrid怎样使它显示的行间隔改变颜色?就向.NET中同名控件一样。  
---------------------------------------------------------------  
 
好像是在  OnDrawDataCell  事件中写代码。  
---------------------------------------------------------------  
 
procedure  TForm1.dbgridDrawColumnCell(Sender:  TObject;  
   const  Rect:  TRect;  DataCol:  Integer;  Column:  TColumn;  
   State:  TGridDrawState);  
begin  
         if  DBGrid2.DataSource.DataSet.RecNo  mod  2=1  then  
         begin  
               DBGrid2.Canvas.Font.Color  :=  clBlue;  
               DBGrid2.Canvas.Brush.Color:=clyellow;  
         end  
         else  begin  
               DBGrid2.Canvas.Font.Color  :=  clred;  
               DBGrid2.Canvas.Brush.Color:=  clGradientActiveCaption;  
         end;  
         DBGrid2.DefaultDrawColumnCell(Rect,  DataCol,  Column,  State);  
end;






  • 上一篇文章:
  • 下一篇文章:
  • 分享此文:该页面添加到 Mister Wong 添加到雅虎Yahoo!收藏 Add to:Del.icio.us Post to Furl Digg this 添加到Google书签 reddit spurl blogmarks 365Key 评论  收藏  分享  打印
     我来说两句
    姓名:       验证码:   
    主页: 
    评分: 1分 2分 3分 4分 5分
    本频道近期热评文章:
      关于我们 | 联系我们 | 站点地图 | 广告投放 | 友情链接 | 在线留言 | 版权申明
    版权所有 © 2004-2007 顶尖设计(bobd.cn)
    未经授权禁止转载,摘编,复制本站内容或建立镜像. 沪ICP备07504942号 
    网络110
    报警服务