다음을 통해 공유


ExceptionMessageBoxButtons 열거형

Specifies the button to display in the exception message box.

네임스페이스:  Microsoft.SqlServer.MessageBox
어셈블리:  Microsoft.ExceptionMessageBox.dll의 Microsoft.ExceptionMessageBox

구문

‘선언
Public Enumeration ExceptionMessageBoxButtons
‘사용 방법
Dim instance As ExceptionMessageBoxButtons
public enum ExceptionMessageBoxButtons
public enum class ExceptionMessageBoxButtons
type ExceptionMessageBoxButtons
public enum ExceptionMessageBoxButtons

멤버

멤버 이름 설명
OK Display the OK button.
OKCancel Display the OK and Cancel buttons.
YesNoCancel Display Yes, No, and Cancel buttons.
YesNo Display Yes and No buttons.
AbortRetryIgnore Display the Abort, Retry, and Ignore buttons.
RetryCancel Display the Retry and Cancel buttons.
Custom Display 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