if frmSUBFORM=nil then frmSUBFORM:=TfrmSUBFORM.Create(Application); frmSUBFORM.Show;在OnClose中:Action := caFree; frmSUBFORM:= nil;
procedure TMainForm.N83Click(Sender: TObject); begin Try If FrmSetupSendCheckWater = nil then begin FrmSetupSendCheckWater :=TFrmSetupSendCheckWater.Create(self); FrmSetupSendCheckWater.Show; //FrmSetupSendCheckWater.WindowState :=wsMaximized; end else begin FrmSetupSendCheckWater.BringToFront; //FrmSetupSendCheckWater.WindowState := wsMaximized; end; except end;在OnClose中:Action := caFree; FrmSetupSendCheckWater := nil;
OnClose事件:form1:=Nil;action:=cafree;//表示关闭时释放窗体 打开前要动态生成:if form1=nil then form1:=tform1.creat(self); from1.show;
谢谢各位大哥,我现在解决了一部分 if assigned(form4) then begin try application.CreateForm(tform4,form4); manage.Form4.FormStyle:=fsmdichild; manage.Form4.Show; except manage.Form4.FormStyle:=fsmdichild; manage.Form4.Show; end; 我用的TREEVIEW,第一个接点可以了,我晕死~,第二个接点就不行了,第一次能弹出来,第二次死活不出来窗体了都,这是咋回师啊
是if not assigned(form4) then 不是 if assigned(form4) then
象你关闭了的话。就不能用show了啊。
form1:=tform1.create(application);
form1.show;
再在子窗体的onclose 下写Action := caFree
frmSUBFORM:=TfrmSUBFORM.Create(Application);
frmSUBFORM.Show;在OnClose中:Action := caFree;
frmSUBFORM:= nil;
begin
Try
If FrmSetupSendCheckWater = nil then
begin FrmSetupSendCheckWater :=TFrmSetupSendCheckWater.Create(self);
FrmSetupSendCheckWater.Show;
//FrmSetupSendCheckWater.WindowState :=wsMaximized; end
else
begin FrmSetupSendCheckWater.BringToFront;
//FrmSetupSendCheckWater.WindowState := wsMaximized; end;
except
end;在OnClose中:Action := caFree;
FrmSetupSendCheckWater := nil;
打开前要动态生成:if form1=nil then
form1:=tform1.creat(self);
from1.show;
if assigned(form4) then
begin
try
application.CreateForm(tform4,form4);
manage.Form4.FormStyle:=fsmdichild;
manage.Form4.Show;
except
manage.Form4.FormStyle:=fsmdichild;
manage.Form4.Show;
end;
我用的TREEVIEW,第一个接点可以了,我晕死~,第二个接点就不行了,第一次能弹出来,第二次死活不出来窗体了都,这是咋回师啊
不是
if assigned(form4) then