码迷,mamicode.com
首页 > 数据库 > 详细

DBGridEh选择时高亮度显示问题 Delphi

时间:2020-12-05 10:58:46      阅读:6      评论:0      收藏:0      [点我收藏+]

标签:data   pmc   int   user   fan   integer   ado   cno   use   

 
procedure TDbgridForm.DBGrid1DrawColumnCell(Sender: TObject;
  const Rect: TRect; DataCol: Integer; Column: TColumn;
  State: TGridDrawState);
begin
  with DBGrid1 do
  begin
   if ((State = [gdSelected]) or (State=[gdSelected,gdFocused])) then
    begin
     Canvas.Font.Color :=ClYellow;
     Canvas.Brush.Color :=ClNavy;
    end
    else
    begin
      if  DataSource1.DataSet.RecNo mod 2<>0 then 
        Canvas.brush.Color :=ClWhite        
      else
        Canvas.brush.Color :=clgreen;       
    end;
    DefaultDrawColumnCell(Rect, DataCol, Column, State); 
  end;
end;

引用:https://bbs.csdn.net/topics/30305871

DBGridEh选择时高亮度显示问题 Delphi

标签:data   pmc   int   user   fan   integer   ado   cno   use   

原文地址:https://www.cnblogs.com/jijm123/p/14067549.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!