Autor Beitrag
Cancer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: So 26.12.04 23:08 
Hi Leude
Also ich bin wie bekloppt am suchen doch leider finde ich nichts zu meinem Problem und wenn dann nur bruchstücke.
Also ich bräuchte einen Code wo ich beim schließen des Formulars z.b den Inhalt von Listbox1 in eine ini File speichere und den Inhalt von Listbox2 auch in eine ini und dann beim öffnen des Formulars den Inhalt der ini Files wieder in dem entsprechende Listboxen schreibt.
Wäre cool wenn ihr mir damit helfen könnet.
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: So 26.12.04 23:51 
Speichern:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Button1Click(Sender: TObject);
begin

  with TIniFile.Create('C:\MyIniFile.ini'do
    try
      WriteString(Self.Name, ListBox1.Name, ListBox1.Items.DelimitedText);
    finally
      Free;
    end;

end;


Lesen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Button2Click(Sender: TObject);
begin

  with TIniFile.Create('C:\MyIniFile.ini'do
    try
      ListBox1.Items.DelimitedText := ReadString(Self.Name, ListBox1.Name, '');
    finally
      Free;
    end;

end;

_________________
Ciao, Sprint.
Cancer Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Mo 27.12.04 00:07 
Jo danke Sprint für die Superschnelle hilfe habe sie direkt angewandt und sie funzt.
Du hast nicht umsonst diesen Nickname!! :lol:

Kennst du dich mit ini´s aus?Hätte da noch eine Frage.