https://documentation.xojo.com/api/language/me.htmlssageDialog
Am I doing something wrong? The other buttons hi-lite upon pressing TAB but never fire on pressing the Enter key. Works via mouse click.
Var d As New MessageDialog // declare the MessageDialog object
Var b As MessageDialogButton // for handling the result
d.IconType = MessageDialog.IconTypes.Caution // 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 = "Use TAB to navigated to the button and press enter."
d.Explanation = "Though the correct button is highlited " + Chr(13) + Chr(10) + _
"The default button is the one that fires. "
b = d.ShowModal // display the dialog
Select Case b // determine which button was pressed.
Case d.ActionButton
// user pressed Save
MessageBox("user pressed save")
Case d.AlternateActionButton
// user pressed Don't Save
MessageBox("user pressed Don't save")
Case d.CancelButton
// user pressed Cancel
MessageBox("user pressed cancel")
End Select