不重复创建子窗体
if not IsWindowExists('frm_spbm') then
Application.CreateForm(Tfrm_spbm,frm_spbm);
frm_spbm.show;
function IsWindowExists(form_1:string):boolean ;
var com_count,i:integer;
begin
com_count:=strtoint((inttostr(Application.ComponentCount)))-1;
for i:=0 to com_count do
begin
if Application.Components[i].Name=form_1 then
break;
end;
if i > com_count then
result:=false
else
result:=true;
end;
这样不行
if not assigned(frm_spbm) then
Application.CreateForm(Tfrm_spbm,frm_spbm);
frm_spbm.show;
这样也不行,还是重复创建了,怎么回事