Construct the dialog.
Construct the dialog.
Set the default button.
Set the detail message. The message detail will be presented beneath the main message and, where supported by the OS, in a less emphasized font than the main message.
Set the preset dialog icon. It must be one of the following: error, info, question or warning.
Set the main message to display in the message dialog.
Set the message dialog type. Arranges for a predefined set of buttons to be displayed.
Show the dialog.
Get the dialog result. This varies on the type of dialog used and will reflect the overall result expected of each dialog.
Remove any leading or trailing braces.
Show the dialog.
auto dialog = new MessageDialog("Save file?") .setIcon(MessageDialogIcon.question) .setMessage("Do you want to save this file?") .setType(MessageDialogType.okcancel) .show(); string buttonClicked = dialog.getResult();
Result: The symbolic name of the button pressed.
Pops up a dialog box with a user defined message and buttons.