1 out of 1 rated this helpful - Rate this topic

MessageBoxResult Enumeration

Represents a user's response to a message box.

Namespace:  System.Windows
Assembly:  System.Windows (in System.Windows.dll)
public enum MessageBoxResult
Member name Description
Supported by Silverlight for Windows Phone None This value is not currently used.
Supported by Silverlight for Windows Phone OK The user clicked the OK button.
Supported by Silverlight for Windows Phone Cancel The user clicked the Cancel button or pressed ESC.
Supported by Silverlight for Windows Phone Yes This value is not currently used.
Supported by Silverlight for Windows Phone No This value is not currently used.

This enumeration is used by the MessageBox.Show method.

The following code example demonstrates how to use this enumeration.


MessageBoxResult result = 
    MessageBox.Show("Would you like to see the simple version?", 
    "MessageBox Example", MessageBoxButton.OKCancel);

if (result == MessageBoxResult.OK)
{
    MessageBox.Show("No caption, one button.");
}


Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ