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;
时间: 2024-11-05 13:36:21