Ich hab' zwar keine Ahnung, was ihr/du machst, aber das geht:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
MyForm: TForm2;
begin
MyForm := TForm2.Create(nil);
MyForm.Button1.OnClick := MyForm.Button1Click;
MyForm.Show;
end;
mit
Delphi-Quellcode:
type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
begin
Hide;
end;