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

 
复制代码
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

posted on   癫狂编程  阅读(305)  评论(0编辑  收藏  举报

导航

< 2025年1月 >
29 30 31 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 1
2 3 4 5 6 7 8
好的代码像粥一样,都是用时间熬出来的
点击右上角即可分享
微信分享提示