![]() |
Tstringgrid auffüllen
Hallo,
wie kann ich alle noch leeren Felder in einem Stringgrid mit einem zufällig generierten Buchstaben auffüllen? |
Re: Tstringgrid auffüllen
Zum Beispiel so:
Delphi-Quellcode:
Grüße vom marabu
procedure RandomFillGrid(sg: TStringGrid);
var iCol, iRow: Integer; begin with sg do for iRow := FixedRows to Pred(RowCount) do for iCol := FixedCols to Pred(ColCount) do if Cells[iCol, iRow] = '' then Cells[iCol, iRow] := Chr(Ord('A') + Random(26)); end; |
Re: Tstringgrid auffüllen
.. und im Form1.create das randomize nicht vergessen
Grüße Klaus |
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:40 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz