firemonkey打开子窗体

procedure TForm1.Button1Click(Sender: TObject);
var
ChildForm: TForm2;
begin
ChildForm := TForm2.Create(nil);
ChildForm.ShowModal(
procedure(ModalResult: TModalResult)
begin
if ModalResult = mrOK then
begin
// 要做的动作
end;
end);
end;

 

子窗体如何释放

procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := TCloseAction.caFree;
end;

你可能感兴趣的:(firemonkey打开子窗体)