![]() |
Re: Checkbox.Caption in Stringgrid
StringGrid1.Cells[1,StringGrid1.rowCount-1]:=(FindComponent( "CheckBox' + IntToStr( i)) as TCheckBox).caption;
Bei Dir/mir fehlte wohl eine Klammer. Grüße Klaus |
Re: Checkbox.Caption in Stringgrid
Liste der Anhänge anzeigen (Anzahl: 1)
also meckern tut er nicht mehr nur jetzt ist das problem anderswaltig da und zwar fängt er nicht in der 1.spalte an bzw in der ersten spalte zweite zeile sondern weiter unten aber eintragen tut er dafür schonmal vielen dank!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
vllt ne idee woran es liegen könnte? problem siehe screenshot(s. scrollbar und freie felde über "deutsch") |
Re: Checkbox.Caption in Stringgrid
Ach so, Deine Tabelle hat schon eine bestimmte Anzahl an Zeilen.
Delphi-Quellcode:
und zeile noch als Variable im Buttonklick vereinbaren.
Zeile :=1; // hier die Startzeile eintragen
for i := 1 to <Anzahl Checkboxen) do begin if (FindComponent( "CheckBox' + IntToStr( i)) as TCheckBox).Checked then begin if Zeile >= StringGrid1.RowCount -1 then StringGrid1.RowCount:=StringGrid1.rowCount +1; StringGrid1.Cells[1,Zeile]:=(FindComponent( "CheckBox' + IntToStr( i)) as TCheckBox).caption; inc(Zeile); end; end; Grüße Klaus |
Re: Checkbox.Caption in Stringgrid
ok habe nun deinen rat befolgt! klappt wunderbar danke nur noch eine kleine frage wie schaffe ich es dann dass die erste zeile wenn ich nur eine habe fixed ist?
|
Re: Checkbox.Caption in Stringgrid
Zitat:
Dann mußt Du halt den Code zum befüllen des Grids entsprechend anpassen. Zeile 0 ist dann die fixed Zeile Zeile 1 ist leer, RowCount ist 2.
Delphi-Quellcode:
Dann sollte das so gehen.
Zeile :=1; // hier die Startzeile eintragen
for i := 1 to <Anzahl Checkboxen) do begin if (FindComponent( "CheckBox' + IntToStr( i)) as TCheckBox).Checked then begin if Zeile > StringGrid1.RowCount -1 then // das = Zeichen aus >= entfernt StringGrid1.RowCount:=StringGrid1.rowCount +1; StringGrid1.Cells[1,Zeile]:=(FindComponent( "CheckBox' + IntToStr( i)) as TCheckBox).caption; inc(Zeile); end; end; Grüße Klaus |
Re: Checkbox.Caption in Stringgrid
Alles Bestens klappt einweindfrei! Vielen dank!
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:49 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