delphi动态创建窗体

2024-11-06 13:41:26
推荐回答(2个)
回答1:

procedure TForm1.Button1Click(Sender: TObject);
Var
MyForm:TForm;
begin
MyForm:=TForm.Create(self);
MyForm.Parent:=self;
MyForm.Show; //把myform.showmodal改为myform.show
end;

回答2:

不设置Parent属性