ExceptionMessageBoxButtons 列挙型

定義

例外メッセージ ボックスに表示するボタンを指定します。

public enum class ExceptionMessageBoxButtons
public enum ExceptionMessageBoxButtons
type ExceptionMessageBoxButtons = 
Public Enum ExceptionMessageBoxButtons
継承
ExceptionMessageBoxButtons

フィールド

名前 説明
AbortRetryIgnore 4

[中止]、[再試行]、および [無視] ボタンを表示します。

Custom 6

カスタム ボタン テキストのボタンを表示します。

OK 0

[OK] ボタンを表示します。

OKCancel 1

[OK] ボタンと [キャンセル] ボタンを表示します。

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 を呼び出してユーザーがクリックしたボタンを判別します。

適用対象