Einzelnen Beitrag anzeigen

Benutzerbild von Binärbaum
Binärbaum

Registriert seit: 19. Jan 2005
Ort: Elstra
764 Beiträge
 
Delphi 7 Enterprise
 
#4

Re: StringGrid nach StrigGrid

  Alt 24. Feb 2005, 14:44
Zitat von Sharky:
Hai Binärbaum,

das ganze müsste auch mit einer Schleife gehen

Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
  ndx : Integer;
begin
  Form2.StringGrid2.ColCount:= Form1.StringGrid2.ColCount;
  Form2.StringGrid2.RowCount:= Form1.StringGrid2.RowCount;

  for ndx := 0 to StringGrid1.RowCount do
  begin
    Form2.StringGrid1.Rows[ndx] := Form1.StringGrid1.Rows[ndx];
  end;
end;
War mir fast schon klar, dass da jemand eine einfachere/ bessere Lösung hat. Die Frage ist nur, ob dieser Code auch wirklich schneller ist, da Rows ja auch auf die einzelnen Felder einer Zeile zugreifen muss, oder nicht?
There are exactly 10 kinds of people: those who understand binary, and those who don't.
---
"Software reift beim Kunden. Bei Hardware ist es anders: Hardware fault beim Kunden." - Rainer G. Spallek
  Mit Zitat antworten Zitat