Retested this here with the MultiForm demo where I changed the code in the main form to get the modalresult with:
procedure TForm1.WebButton1Click(Sender: TObject);
var
newform: TForm2;
mr: TModalResult;
begin
newform := TForm2.Create(Self);
newform.Caption := 'Child form';
newform.Popup := WebRadioGroup1.ItemIndex <> 0;
case WebRadioGroup1.ItemIndex of
2: newform.Border := fbDialog;
3: newform.Border := fbDialogSizeable;
end;
// used to manage Back button handling to close subform
window.location.hash := 'subform';
// load file HTML template + controls
await(TForm2, newform.Load());
// init control after loading
newform.frm2Edit.Text := WebEdit1.Text;
try
// excute form and wait for close
mr := await(TModalResult, newform.Execute);
ShowMessage('Form 2 closed with new value:"'+newform.frm2Edit.Text+'"/'+mr.ToString);
WebEdit1.Text := newform.frm2Edit.Text;
finally
newform.Free;
end;
end;
and added 2 buttons on the child form with code:
procedure TForm2.WebButton1Click(Sender: TObject);
begin
ModalResult := mrOK;
end;
procedure TForm2.WebButton3Click(Sender: TObject);
begin
ModalResult := mrCancel;
end;
and in the dialog, I see as result either 1 or 2 depending on the OK or Cancel button clicked.