FMX.Platform.IFMXDialogServiceAsync.MessageDialogAsync
Delphi
procedure MessageDialogAsync(const AMessage: string; const ADialogType: TMsgDlgType; const AButtons: TMsgDlgButtons;
const ADefaultButton: TMsgDlgBtn; const AHelpCtx: THelpContext; const ACloseDialogProc: TInputCloseDialogProc); overload;
procedure MessageDialogAsync(const AMessage: string; const ADialogType: TMsgDlgType; const AButtons: TMsgDlgButtons;
const ADefaultButton: TMsgDlgBtn; const AHelpCtx: THelpContext; const ACloseDialogEvent: TInputCloseDialogEvent;
const AContext: TObject = nil); overload;
C++
virtual void __fastcall MessageDialogAsync(const System::UnicodeString AMessage, const System::Uitypes::TMsgDlgType ADialogType, const System::Uitypes::TMsgDlgButtons AButtons, const System::Uitypes::TMsgDlgBtn ADefaultButton, const System::Classes::THelpContext AHelpCtx, const Fmx::Dialogs::_di_TInputCloseDialogProc ACloseDialogProc) = 0 /* overload */;
virtual void __fastcall MessageDialogAsync(const System::UnicodeString AMessage, const System::Uitypes::TMsgDlgType ADialogType, const System::Uitypes::TMsgDlgButtons AButtons, const System::Uitypes::TMsgDlgBtn ADefaultButton, const System::Classes::THelpContext AHelpCtx, 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 a custom message, dialog type, set of buttons and help context ID.
MessageDialogAsync works asynchronously. Calls to MessageDialogAsync finish instantaneously, they do not wait for the user to close the dialog box. To work synchronously, use IFMXDialogServiceSync.MessageDialogSync.
MessageDialogAsync receives the following parameters:
AMessageis the text message.ADialogTypeis the dialog type.AButtonsis the set of buttons.ADefaultButtonis the button that has the focus by default.AHelpCtxis the help context ID.ACloseDialogProcorACloseDialogEventis an anonymous method or event handler that is called after the user closes the dialog box.
Note: The Help button does not trigger a call because it does not close the dialog box.
AContextis an optional object that you can provide as a context for the event handler assigned toACloseQueryEvent.
When the user closes the dialog box, MessageDialogAsync calls the specified anonymous method or event handler with the following arguments:
Sender(ACloseDialogEventonly) contains the specifiedAContext.AResultis the modal result value of the button used to close the dialog box.
To call MessageDialogAsync without the need of an instance of IFMXDialogServiceAsync, use TDialogServiceAsync.MessageDialog instead.
Platform Support
| Platform | Support |
|---|---|
| Windows | |
| macOS | |
| iOS | |
| Android |
See Also
- FMX.Platform.IFMXDialogServiceAsync.InputQueryAsync
- FMX.Platform.IFMXDialogServiceAsync.ShowMessageAsync
- FileExists (Delphi) code example
- TStringBuilderClickCount (Delphi) code example
- FileExists (C++) code example
- TStringBuilderClickCount (C++) code example
- FMX.MessageAlerts sample application