procedure TForm1.FormCreate(Sender: TObject);<br>begin<br> Form2:=nil;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br> if Form2=nil then<br> Form2:=TForm2.Create(Self);<br> Form2.Show;<br>end;<br><br>procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);<br>begin<br> Form2:=nil;<br> Action:=caFree;<br>end;<br><br>以上代码是在线写的,分都给我吧。