Skip to content Skip to sidebar Skip to footer

Closing Modal Dialog In Delphi Firemonkey Mobile Application (android)

I am having the dandiest time trying to figure out why my modal form will not close! Using Delphi XE-5 and FireMonkey Mobile App (Android), i followed the the info 'ShowModal Dialo

Solution 1:

In order to close your modal dialog, use this pattern:

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

and remove your call Form2.DisposeOf;, since the ModalResult setter needs to operate on a valid object.

The documentation has been updated in XE7, see Using FireMonkey Modal Dialog Boxes.

See also ShowModal on Android for the details why DisposeOf is wrong.

Post a Comment for "Closing Modal Dialog In Delphi Firemonkey Mobile Application (android)"