xtd - Reference Guide  0.1.0
Modern c++17 framework to create console, gui and unit test applications on Windows, macOS and Linux.

§ dialog_result

Specifies identifiers to indicate the return value of a dialog box.

Remarks
The Button.DialogResult property and the form.show_dialog method use this enumeration.
Examples
The following code example demonstrates how to display a MessageBox with the options supported by this overload of Show. After verifying that a string variable, ServerName, is empty, the example displays a MessageBox, offering the user the option to cancel the operation. If the Show method's return value evaluates to Yes, the form that displayed the MessageBox is closed.
void validate_user_entry() {
// Checks the value of the text.
if (server_name.text().size() == 0) {
// Initializes the variables to pass to the MessageBox.Show method.
string message = "You did not enter a server name. Cancel this operation?";
string caption = "No Server Name Specified";
dialog_result result;
// Displays the MessageBox.
result = message_box::show(*this, message, caption, buttons);
if (result == dialog_result::yes) {
// Closes the parent form.
close();
}
}
}
Enumerator
none 

Nothing is returned from the dialog box. This means that the modal dialog continues running.

ok 

The dialog box return value is OK (usually sent from a button labeled OK).

cancel 

The dialog box return value is Cancel (usually sent from a button labeled Cancel).

abort 

The dialog box return value is Abort (usually sent from a button labeled Abort).

retry 

The dialog box return value is Retry (usually sent from a button labeled Retry).

ignore 

The dialog box return value is Ignore (usually sent from a button labeled Ignore).

yes 

The dialog box return value is Yes (usually sent from a button labeled Yes).

no 

The dialog box return value is No (usually sent from a button labeled No).