Einzelnen Beitrag anzeigen

hoika

Registriert seit: 5. Jul 2006
Ort: Magdeburg
8.270 Beiträge
 
Delphi 10.4 Sydney
 
#4

AW: TAdvStringGrid: OnGetCellText vs. AutoSizeCol

  Alt 18. Aug 2016, 19:44
Hallo,
das klappt alles ohne die "Umwege".
Hätte ich nicht gedacht.

Delphi-Quellcode:

procedure TForm69.SGGetDisplText(Sender: TObject; ACol, ARow: Integer;
  var Value: string);
begin
  if CBOnGetCellText.Checked then
  begin
    Value := IntToStr(ACol)+'/'+IntToStr(ARow)
  end;
end;

procedure TForm69.CBOnGetCellTextClick(Sender: TObject);
var
  iTick1: Integer;
  iTick2: Integer;
begin
  iTick1 := GetTickCount;

  SG.RowCount := 2;

  SG.RowCount := 30000;
  SG.Invalidate;

  iTick2 := GetTickCount;

  AutoSize;

  MessageBox(0, PChar(IntToStr(iTick2-iTick1)), 'Dauer (msec)', 0);
end;

procedure TForm69.AutoSize;
var
  iCol: Integer;
begin
  for iCol:= 0 to SG.ColCount-1 do
  begin
    begin
      SG.AutoSizeCol(iCol);
    end;
  end;
end;
Heiko
  Mit Zitat antworten Zitat