Einzelnen Beitrag anzeigen

lucy

Registriert seit: 25. Okt 2017
63 Beiträge
 
Delphi XE7 Starter
 
#3

AW: StringGrid Zeile hinzufügen

  Alt 14. Nov 2022, 18:42
bekomme es einfach nicht hin?
es werden immer zwei neue Zeilen erzeugt... bzw. eine überschrieben

Delphi-Quellcode:
procedure TForm2.Button1Click(Sender: TObject);
 var
i: integer;
begin
 StringGrid1.RowCount := StringGrid1.RowCount +1;
    for i := StringGrid1.RowCount - 2 downto StringGrid1.FixedRows + 1 do
    begin
     StringGrid1.Rows [i].Assign (StringGrid1.Rows [i -1]);
     StringGrid1.Cells [1, StringGrid1.FixedRows] := FormatDateTime ('dd:mm:yyyy', Now);
     StringGrid1.Cells [2, StringGrid1.FixedRows] := FormatDateTime ('hh:nn:ss', Now);
     StringGrid1.Cells [3, StringGrid1.FixedRows] := ('Log');
 end;
end;
Miniaturansicht angehängter Grafiken
bild.jpg  
  Mit Zitat antworten Zitat