MessageBoxResult Enumeration
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Represents a user's response to a message box.
Namespace: System.Windows
Assembly: System.Windows (in System.Windows.dll)
Syntax
'Declaration
Public Enumeration MessageBoxResult
public enum MessageBoxResult
Members
Member name | Description | |
---|---|---|
None | This value is not currently used. | |
OK | The user clicked the OK button. | |
Cancel | The user clicked the Cancel button or pressed ESC. | |
Yes | This value is not currently used. | |
No | This value is not currently used. |
Examples
The following code example demonstrates how to use this enumeration.
Dim result As MessageBoxResult = _
MessageBox.Show("Would you like to see the simple version?", _
"MessageBox Example", MessageBoxButton.OKCancel)
If (result = MessageBoxResult.OK) Then
MessageBox.Show("No caption, one button.")
End If
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.");
}
Version Information
Silverlight
Supported in: 5, 4, 3
Silverlight for Windows Phone
Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.