主窗口菜单调用子窗口是出错,调用命令是:
if form2=nil then application.createform(Tform,form2);
form2.showmodal;
freeandnil(form2);出错提示是:
Error in module: Call to Application CreateForm is missing or incorrect.怎么回事?
if form2=nil then application.createform(Tform,form2);
form2.showmodal;
freeandnil(form2);出错提示是:
Error in module: Call to Application CreateForm is missing or incorrect.怎么回事?
var
form2:Tform2;
begin
//...
if not assigend(form2) then
form2:=Tform2.create(application);
form2.showmodal;
freeandnil(form2);
//..
procedure TForm1.Button1Click(Sender:TObject);
begin
if not assigned(Form2) then
Form2:=TForm2.Create(nil);
Form2.ShowModal;
end;