![]() |
Alle Editfelder in txt speichern
Hallo, ich habe schon das gleiche Thema unter
![]() |
Re: Alle Editfelder in txt speichern
So sollte das funktionieren:
Delphi-Quellcode:
Speicher.Add(TComboBox(FindComponent(ComboBox + IntToStr(i))).Text);
|
Re: Alle Editfelder in txt speichern
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var i:Integer; StringList:TStringList; begin StringList := TStringList.Create(); StringList.BeginUpdate(); for i:=0 to ComponentCount-1 do begin if Components[i] is TEdit then begin StringList.Add( TEdit(Components[i]).Text ); end; if Components[i] is TComboBox then begin StringList.Add( TComboBox(Components[i]).Text ); end; end; StringList.EndUpdate(); StringList.SaveToFile( 'c:\myEditFelder.txt' ); end; |
Re: Alle Editfelder in txt speichern
Zu volkerw:
Hier tritt folgendes Problem auf: undefinierter Bezeichner 'ComboBox' Zu sniper_w: Hier ist das Problem ähnlich: undefinierter Bezeichner 'Text' unter:
Delphi-Quellcode:
Hab leider noch nicht so lange Informatik und weis jetzt nicht wie ich weitermachen soll.
StringList.Add( TEdit(Components[i]).Text );
|
Re: Alle Editfelder in txt speichern
Zitat:
Delphi-Quellcode:
Speicher.Add(TComboBox(FindComponent('ComboBox' + IntToStr(i))).Text);
|
Re: Alle Editfelder in txt speichern
Super, dass funktioniert so.
Vielen Dank an alle :thumb: |
Re: Alle Editfelder in txt speichern
Zitat:
|
Re: Alle Editfelder in txt speichern
vielleicht liegt es an der Delphiversion die Martin.Ghosts verwendet. Leider könn wir da nur vermutungen anstellen da keine delphiversion angegeben wurde.
|
Re: Alle Editfelder in txt speichern
Es handelt sich um Delphi 7.
|
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