Registriert seit: 13. Nov 2008
56 Beiträge
Turbo Delphi für Win32
|
Re: Promblem bei Listbox speichern
24. Nov 2008, 21:00
Delphi-Quellcode:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Edit2: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
ListBox1: TListBox;
Label4: TLabel;
Label5: TLabel;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var l,d,Pfad: string;
begin
l:=edit1.text;
d:=edit2.Text;
label5.caption:=(l)+ ' - '+(d);
listbox1.Items.add(label5.caption);
edit1.Clear;
edit2.Clear;
Pfad := ExtractFilePath(ParamStr(0)) + ' liste.txt';
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ListBox1.Items.LoadFromFile(' liste.txt');
end;
end.
|
|
Zitat
|