Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi gegensatz zu rowcount (https://www.delphipraxis.net/127393-gegensatz-zu-rowcount.html)

Lannes 12. Jan 2009 18:28

Re: gegensatz zu rowcount
 
Hallo,

bis ich das dann geklärt hab mach ich es mal so: :mrgreen:

Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
begin
  StringGrid1.RowCount := 3;
  StringGrid1.ColCount := 3;
  StringGrid1.Rows[1].Text := 'eins'+#13#10+'zwei'+#13#10+'drei'+#13#10+#13#10;
  //Rows[x].Count jetzt 4
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  StringGrid1.Cells[3,1] := 'test';
  StringGrid1.Rows[1].Exchange(1,3);
  StringGrid1.Rows[1].Exchange(3,2);
end;

Der.Kaktus 12. Jan 2009 18:29

Re: gegensatz zu rowcount
 
Zitat:

Zitat von Lannes
Hallo,

bis ich das dann geklärt hab mach ich es mal so: :mrgreen:

Delphi-Quellcode:
procedure TForm1.FormCreate(Sender: TObject);
begin
  StringGrid1.RowCount := 3;
  StringGrid1.ColCount := 3;
  StringGrid1.Rows[1].Text := 'eins'+#13#10+'zwei'+#13#10+'drei'+#13#10+#13#10;
  //Rows[x].Count jetzt 4
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  StringGrid1.Rows[1].Exchange(1,3);
  StringGrid1.Rows[1].Exchange(3,2);
end;

Das iss ja von hinten durch die Brust ins Auge :-D

Klaus01 12. Jan 2009 19:15

Re: gegensatz zu rowcount
 
Guten Abend,

marabu hatte hier diesen Code
zum Einfügen von Zeilen in das StringGrid gepostet:
Delphi-Quellcode:
procedure TDemoForm.InsertRow(iRow: integer);
var
  i: integer;
begin
  with StringGrid do begin
    if iRow < FixedRows then
      raise Exception.Create('you cannot insert a fixed row');
    RowCount := RowCount + 1;
    for i := RowCount - 1 downto Succ(iRow) do
      Rows[i].Assign(Rows[i-1]);
    Rows[iRow].Clear;
  end;
end;
Grüße
Klaus


Alle Zeitangaben in WEZ +1. Es ist jetzt 17:13 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz