FMX.Platform.IFMXDialogServiceAsync.ShowMessageAsync
Delphi
procedure ShowMessageAsync(const AMessage: string); overload;
procedure ShowMessageAsync(const AMessage: string; const ACloseDialogProc: TInputCloseDialogProc); overload;
procedure ShowMessageAsync(const AMessage: string; const ACloseDialogEvent: TInputCloseDialogEvent;
const AContext: TObject = nil); overload;
C++
virtual void __fastcall ShowMessageAsync(const System::UnicodeString AMessage) = 0 /* overload */;
virtual void __fastcall ShowMessageAsync(const System::UnicodeString AMessage, const Fmx::Dialogs::_di_TInputCloseDialogProc ACloseDialogProc) = 0 /* overload */;
virtual void __fastcall ShowMessageAsync(const System::UnicodeString AMessage, const Fmx::Dialogs::TInputCloseDialogEvent ACloseDialogEvent, System::TObject* const AContext = (System::TObject*)(0x0)) = 0 /* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | FMX.Platform.pas FMX.Platform.hpp |
FMX.Platform | IFMXDialogServiceAsync |
Description
Displays a dialog box with the specified message and an OK button.
ShowMessageAsync works asynchronously. Calls to ShowMessageAsync finish instantaneously, they do not wait for the user to close the dialog box. To work synchronously, use IFMXDialogServiceSync.ShowMessageSync. FMX.Dialogs.ShowMessage works differently depending on the run-time platform.
ShowMessageAsync receives the following parameters:
AMessage
is the text message.ACloseDialogProc
orACloseQueryEvent
is an optional anonymous method or event handler that is called after the user closes the dialog box.AContext
is an optional object that you can provide as a context for the event handler assigned toACloseQueryEvent
.
When the user closes the dialog box, ShowMessageAsync calls the specified anonymous method or event handler with the following arguments:
Sender
(ACloseQueryEvent
only) contains the specifiedAContext
.AResult
is the modal result value of the button used to close the dialog box.
To call ShowMessageAsync without the need of an instance of IFMXDialogServiceAsync, use TDialogServiceAsync.ShowMessage instead.
Platform Support
Platform | Support |
---|---|
Windows | |
macOS | |
iOS | |
Android |