2017年9月7日 星期四

DBGrid Draw SelectRow

type
  TDataGrid = class (TDBGrid);

procedure TForm1.Grid1DrawDataCell(Sender: TObject; const Rect: TRect;
  Field: TField; State: TGridDrawState);
var
  vRect:TRect;
begin
  vRect := TDataGrid(Grid1).CellRect(TDataGrid(Grid1).Col, TDataGrid(Grid1).Row);
  if Rect.Top=vRect.Top then
  begin
    Grid1.Canvas.Brush.Color := $00FADAC0; //藍色
    Grid1.DefaultDrawDataCell(Rect, Field, State);
  end;

end;

沒有留言:

張貼留言