问题描述:
在一DBGRID中当我选中某一行时此行字体变大背景色改变!具体在哪个事件中写以及相关代码!我也查了好多资料但那些都是在DBGRID没有显示的情况下做的处理!
我找到了改变当前选中的CELL的字体背景改变方法但整行改变我还没有找到请各位帮忙!

解决方案 »

  1.   

    procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
     DataCol: Integer; Column: TColumn; State: TGridDrawState);
    begin
     with TDBGrid(Sender) do
     begin
         Canvas.Font.Color:=clWhite;
         Canvas.Brush.Color:=$00800040;
     end;
      

  2.   

    搞不定
    我想应该用 api     windows.DrawFocusRect()
      

  3.   

    dgRowSelect设为true;
    ...
      if gdSelected in State then
      begin
        DBGrid.Canvas.Brush.Color := clSkyBlue;
        DBGrid.Canvas.Font.Size := 12;
      end;
      DBGrid.DefaultDrawColumnCell(Rect, DataCol, Column, State);
    ...
      

  4.   

    你这个行是行但不能编辑某一列了,这样的话我的DBGRID中的数据是只读了,不能编辑,怎么办?
      

  5.   

    我早已给你发过去了,你收到了吗?你不要直接编辑DBGrid,用DBEdit、DBMemo、DBComboBox等关联