ExceptionMessageBoxButtons 열거형

정의

예외 메시지 상자에 표시할 단추를 지정합니다.

public enum class ExceptionMessageBoxButtons
public enum ExceptionMessageBoxButtons
type ExceptionMessageBoxButtons = 
Public Enum ExceptionMessageBoxButtons
상속
ExceptionMessageBoxButtons

필드

AbortRetryIgnore 4

중단, 다시 시도무시 단추를 표시합니다.

Custom 6

사용자 지정 단추 텍스트가 있는 단추를 표시합니다.

OK 0

확인 단추를 표시 합니다 .

OKCancel 1

확인취소 단추를 표시합니다.

RetryCancel 5

다시 시도취소 단추를 표시합니다.

YesNo 3

아니요 단추를 표시합니다.

YesNoCancel 2

, 아니요취소 단추를 표시합니다.

예제

// 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

설명

사용할 Custom때 메시지 상자를 표시하기 전에 단추 텍스트를 설정하기 위해 호출 SetButtonText 해야 합니다. 사용자가 예외 메시지 상자를 해제한 후 호출 CustomDialogResult 하여 사용자가 클릭한 단추를 확인합니다.

적용 대상