判断一下阿!在form1 button click 代码中修改:
if not form2.showing then form2.showmodal;
同样,修改form2 button click:
if not form1.showing then form1.showmodal;
不过,不明白你要干什么!既然showmodal,还激活其他窗体干什么?会有问题哦!
if not form2.showing then form2.showmodal;
同样,修改form2 button click:
if not form1.showing then form1.showmodal;
不过,不明白你要干什么!既然showmodal,还激活其他窗体干什么?会有问题哦!
procedure TForm2.Button1Click(Sender: TObject);
begin
try
form1:=Tform1.create(application);
form1.showmodal
finally
form1.free;
end;
end;
在FORM2的按钮上:
procedure TForm2.Button1Click(Sender: TObject);
begin
try
form1:=Tform1.create(application);
form1.showmodal
finally
form1.free;
end;
end;
在FORM1的按钮上:
procedure TForm1.Button1Click(Sender: TObject);
begin
try
form2:=Tform2.create(application);
form2.showmodal
finally
form2.free;
end;
end;
我试过了没问题。