if assigned(form1)=nil then form1:=Tform.create(applicaiton); form1.show;onclose action:=fafree;ondestroy form1:=nil;
在MDI子窗体的onclose事件中写: action:=cafree;
以前我也遇过这个问题但解决方法很简单,应该有一个更好的办法,请各位高手指教! 我的方法: 在使窗体激活建立事件中添加: if 你的mdi子窗体=nil then 你的mdi子窗体:=T你的mdi子窗体.Create(self); if f你的mdi子窗体.WindowState=wsMinimized then 你的mdi子窗体.WindowState:=wsnormal; 你的mdi子窗体.showmodal; 在窗体onclose事件添加: Action:=cafree; 你的mdi子窗体:=nil;
form1:=Tform.create(applicaiton);
form1.show;onclose
action:=fafree;ondestroy
form1:=nil;
action:=cafree;
我的方法:
在使窗体激活建立事件中添加:
if 你的mdi子窗体=nil
then 你的mdi子窗体:=T你的mdi子窗体.Create(self);
if f你的mdi子窗体.WindowState=wsMinimized
then 你的mdi子窗体.WindowState:=wsnormal;
你的mdi子窗体.showmodal;
在窗体onclose事件添加:
Action:=cafree;
你的mdi子窗体:=nil;