Export (0) Print
Expand All
Expand Minimize
2 out of 2 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 nameDescription
Supported by Silverlight for Windows PhoneNoneThis value is not currently used.
Supported by Silverlight for Windows PhoneOKThe user clicked the OK button.
Supported by Silverlight for Windows PhoneCancelThe user clicked the Cancel button or pressed ESC.
Supported by Silverlight for Windows PhoneYesThis value is not currently used.
Supported by Silverlight for Windows PhoneNoThis 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)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.