unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Unit2;
type
TForm1 =
class(TForm)
txt1: TEdit;
cmd1: TButton;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure cmd1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
Form2 := TForm2.Create( Self );
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
FreeAndNil( Form2 );
end;
procedure TForm1.cmd1Click(Sender: TObject);
begin
Form2.ListBox1.Items.Add( txt1.Text );
end;
end.