我动态创建窗体关闭后在点创建就弹出
project pmain.exe raised exception class eacessviolation with message 'accessviolation at address 00403501 in module 'pmain.exe'. read of address 00000026'.process stopped. use step or run to continue.
创建其他窗体就没错
project pmain.exe raised exception class eacessviolation with message 'accessviolation at address 00403501 in module 'pmain.exe'. read of address 00000026'.process stopped. use step or run to continue.
创建其他窗体就没错
begin
if isxgxx=0 then
begin
fedit:=tfedit.create(application);
fedit.WindowState:=wsmaximized;
fedit.show;
isxgxx:=1;
end
else
begin
fedit.WindowState:=wsmaximized;
fedit.Show;
end;
end;
正确的写法为procedure Tfmain.RzGroup3Items0Click(Sender: TObject);
begin
if isxgxx=0 then
begin
fedit:=tfedit.create(application);
try
fedit.WindowState:=wsmaximized;
fedit.show;
isxgxx:=1;
finally
fedit.free;
end;
end
else
begin
fedit.WindowState:=wsmaximized;
fedit.Show;
end;
end;
try
打开窗体
finally
释放窗体
end;这样就不会有LZ的问题了 `~~ 嘿嘿 分全搞来````