如何删除DrawGrid中的行?

时间:2016-03-29 16:43:21

标签: delphi canvas

我有一个DrawCrid,其中FixedCols = 0,FixedRows = 0,GridLineWidth = 0,GoRowSelect = True,这个OnPaint:

procedure TForm1.DrawGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
var Canvas: TCanvas;
begin
  Canvas := DrawGrid1.Canvas;

  Canvas.Brush.Color := clWhite;
  Canvas.Pen.Color := clRed;
  Canvas.Pen.Style := psSolid;
  Canvas.Pen.Mode := pmCopy;

  Canvas.FillRect(Rect);
end;

然而,当我运行程序并选择行时,我看到一些不应该存在的行。

如何删除默认行?

Example

0 个答案:

没有答案