Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Library: VCL / WinForms / Controls (https://www.delphipraxis.net/24-library-vcl-winforms-controls/)
-   -   Delphi Komplettes Stringgrid löschen (https://www.delphipraxis.net/6684-komplettes-stringgrid-loeschen.html)

Nalincah 18. Jul 2003 12:18


Komplettes Stringgrid löschen
 
Da es im StringGrid meines Wissens nach kein StringGrid.Clear oder ähnliches gibt hab ich folgende kleine Prozedur geschrieben:

Delphi-Quellcode:
function TForm.StringGridLeer;
var
  i:integer;
begin
  for i := StringGrid1.FixedCols to StringGrid1.ColCount - 1 do
  begin
    for j := StringGrid1.FixedRows to StringGrid1.RowCount - 1 do
    begin
      StringGrid1.Cells[i,j] := '';
    end;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  StringGridLeer;
end;
Hinweis: Die festen Zeilen und Spalten (FixedCols bzw. FixedRows) werden dabei ignoriert.

[edit=Chakotay1308]Eintrag korrigiert/erweitert. Mfg, Chakotay1308[/edit]


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:23 Uhr.

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