L
lunyx
Unregistered / Unconfirmed
GUEST, unregistred user!
比如我在form1中创建form2,并show,如下:
procedure TForm1.Button2Click(Sender: TObject);
begin
if not Assigned(form2) then
Application.CreateForm(TForm2,Form2);
Form2.Show;
end;
我现在要在form2的关闭时间中销毁form2;
procedure TForm2.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
FreeAndNil(self);
end;
出现异常!怎么才能实现我的想法?
procedure TForm1.Button2Click(Sender: TObject);
begin
if not Assigned(form2) then
Application.CreateForm(TForm2,Form2);
Form2.Show;
end;
我现在要在form2的关闭时间中销毁form2;
procedure TForm2.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
FreeAndNil(self);
end;
出现异常!怎么才能实现我的想法?