次の方法で共有


ExceptionMessageBox.IsCheckBoxChecked プロパティ

ShowCheckbox が true の場合にチェック ボックスをオンにするかどうかを指定します。

名前空間:  Microsoft.SqlServer.MessageBox
アセンブリ:  Microsoft.ExceptionMessageBox (Microsoft.ExceptionMessageBox.dll)

構文

'宣言
Public Property IsCheckBoxChecked As Boolean 
    Get 
    Set
'使用
Dim instance As ExceptionMessageBox 
Dim value As Boolean 

value = instance.IsCheckBoxChecked

instance.IsCheckBoxChecked = value
public bool IsCheckBoxChecked { get; set; }
public:
property bool IsCheckBoxChecked {
    bool get ();
    void set (bool value);
}
member IsCheckBoxChecked : bool with get, set
function get IsCheckBoxChecked () : boolean 
function set IsCheckBoxChecked (value : boolean)

プロパティ値

型: System.Boolean
Boolean の値です。

説明

既定値は false です。

使用例

          try
            {
                // Do something that may cause an exception.
                throw new ApplicationException("An error has occured.");
            }
            catch (ApplicationException ex)
            {
                string str = "The action failed.";
                ApplicationException exTop = new ApplicationException(str, ex);
                exTop.Source = this.Text;

                // Show a message box if the global variable is true.
                if (alwaysShow)
                {
                    ExceptionMessageBox box = new ExceptionMessageBox(exTop);
                    box.ShowCheckBox = true;
                    box.IsCheckBoxChecked = true;
                    box.CheckBoxText = "Always show this message";
                    box.Show(this);

                    // Set the global variable.
                    alwaysShow = box.IsCheckBoxChecked;
                }
            }
Try
    ' Do something that may cause an exception.
    Throw New ApplicationException("An error has occured.")
Catch ex As ApplicationException
    Dim str As String = "The action failed."
    Dim exTop As ApplicationException = New ApplicationException(str, ex)
    exTop.Source = Me.Text

    ' Show a message box if the global variable is true.
    If alwaysShow Then
        Dim box As ExceptionMessageBox = New ExceptionMessageBox(exTop)
        box.ShowCheckBox = True
        box.IsCheckBoxChecked = True
        box.CheckBoxText = "Always show this message"
        box.Show(Me)

        ' Set the global variable.
        alwaysShow = box.IsCheckBoxChecked
    End If
End Try

関連項目

参照

ExceptionMessageBox クラス

Microsoft.SqlServer.MessageBox 名前空間