Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

ExceptionMessageBoxButtons Enumeration

Specifies the button to display in the exception message box.

Namespace:  Microsoft.SqlServer.MessageBox
Assembly:  Microsoft.ExceptionMessageBox (in Microsoft.ExceptionMessageBox.dll)
public enum ExceptionMessageBoxButtons
Member nameDescription
OKDisplay the OK button.
OKCancelDisplay the OK and Cancel buttons.
YesNoCancelDisplay Yes, No, and Cancel buttons.
YesNoDisplay Yes and No buttons.
AbortRetryIgnoreDisplay the Abort, Retry, and Ignore buttons.
RetryCancelDisplay the Retry and Cancel buttons.
CustomDisplay buttons with custom button text.

When you use Custom, you must call SetButtonText to set the button text before you show the message box. After the user dismisses the exception message box, call CustomDialogResult to determine which button the user clicked.

			// Define the message and caption to display.
			string str = @"Are you sure you want to delete file 'c:\somefile.txt'?";
			string caption = "Confirm File Deletion";

			// Show the exception message box with Yes and No buttons.
			ExceptionMessageBox box = new ExceptionMessageBox(str,
				caption, ExceptionMessageBoxButtons.YesNo,
				ExceptionMessageBoxSymbol.Question,
				ExceptionMessageBoxDefaultButton.Button2);

			if (DialogResult.Yes == box.Show(this))
			{
				// Delete the file.
			}


' Define the message and caption to display.
Dim str As String = "Are you sure you want to delete file 'c:\somefile.txt'?"
Dim caption As String = "Confirm File Deletion"

' Show the exception message box with Yes and No buttons.
Dim box As ExceptionMessageBox = New ExceptionMessageBox(str, _
 caption, ExceptionMessageBoxButtons.YesNo, _
 ExceptionMessageBoxSymbol.Question, _
 ExceptionMessageBoxDefaultButton.Button2)

If Windows.Forms.DialogResult.Yes = box.Show(Me) Then
    ' Delete the file.
End If


Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.