Autor Beitrag
elduchte
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 199

Win 2000, Win XP
Delphi 7
BeitragVerfasst: Do 26.06.03 11:37 
Hallo,
habe eine komische Aufgabe, die ich lösen muss, aber keine Ahnung, wie ich da rangehen kann:

Ich soll ein Formular erstellen. Bei Schließen des Formulars, soll dieses in einer ini abgespeichert werden. Lädt man dann die ini-Datei wieder, soll das Formular geöffnet werden.

Hat jemand einen Tipp ??

Danke
Andreas
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 26.06.03 12:02 
Ini-Datei laden? In was laden? Und was soll abgespeichert werden?
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Do 26.06.03 18:11 
dan ganze formular in die ini speichern ?? impossible !!! du kannst die einzelnen eingenschaften der benutzen kompos speichern und dann wieder laden.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
zero1
Hält's aus hier
Beiträge: 13



BeitragVerfasst: Do 26.06.03 18:23 
ein bsp fürs speichern :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.FormClose(Sender: TObject);
var
INIDatei: TIniFile;
begin
INIDatei := TIniFile.Create('dateiname.ini');
 with INIDatei do
  begin
  WriteString('BlaBla', 'TelNr', edit1.Text);
  WriteString('BlaBla', 'Alter', edit2.Text);
 end;
 INIDatei.Free;
end;


Laden

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
procedure TForm1.FormCreate
var
  Ini: TIniFile;
begin
ini := NIL;
  try
    Ini:=TIniFile.Create('dateiname.ini');
  edit1.Text:=  Ini.ReadString('BlaBla','TelNr','edit1.Text');
  edit2.Text:=  Ini.ReadString('BlaBla','Alter','edit2.Text');
  finally
    Ini.Free;
  end;
end;


damit kannst du saven/laden beim öffnen/schließen :)

aber alles aufeinmal klappt nicht ! da musst du schon alles angeben !

greez zero1
mimi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3458

Ubuntu, Win XP
Lazarus
BeitragVerfasst: Do 26.06.03 18:28 
@elduchte
beschreibe doch mal genauer was du willst.

_________________
MFG
Michael Springwald, "kann kein englisch...."