From Xojo Documentation
Displays the MessageDialog window.
It returns a MessageDialogButton, which indicates which button was pressed. To find out which button was pressed, compare it to the button instances in the dialog.
The following code creates and manages a "Save Changes" dialog box without the need to create an instance of the Window class:
Var b As MessageDialogButton // for handling the result
d.Icon = MessageDialog.GraphicCaution // display warning icon
d.ActionButton.Caption = "Save"
d.CancelButton.Visible = True // show the Cancel button
d.AlternateActionButton.Visible = True // show the "Don't Save" button
d.AlternateActionButton.Caption = "Don't Save"
d.Message = "Do you want to save changes to this document before closing?"
d.Explanation = "If you don't save, your changes will be lost. "
b = d.ShowModal // display the dialog & return pressed button
Select Case b //determine which button was pressed.
// user pressed Save
// user pressed Don't Save
// user pressed Cancel