ExceptionMessageBox.CheckBoxRegistryKey ExceptionMessageBox.CheckBoxRegistryKey ExceptionMessageBox.CheckBoxRegistryKey Property

정의

RegistryKeytrue일 때 예외 메시지 상자에 표시되는 확인란을 제어하는 열린 ShowCheckBox를 설정합니다. Sets an opened RegistryKey that controls the check box that is displayed on the exception message box when ShowCheckBox is true.

public:
 property Microsoft::Win32::RegistryKey ^ CheckBoxRegistryKey { Microsoft::Win32::RegistryKey ^ get(); void set(Microsoft::Win32::RegistryKey ^ value); };
public Microsoft.Win32.RegistryKey CheckBoxRegistryKey { get; set; }
Public Property CheckBoxRegistryKey As RegistryKey
속성 값

RegistryKeytrue일 때 예외 메시지 상자에 표시되는 확인란을 제어하는 ShowCheckBox입니다. A RegistryKey that controls the check box that is displayed on the exception message box when ShowCheckBox is true.

예제

try
{
	// Do something that could generate an exception.
	throw new ApplicationException("An error has occured.");
}
catch (ApplicationException ex)
{
	string str = "The action failed. Do you want to continue?";
	ApplicationException exTop = new ApplicationException(str, ex);
	exTop.Source = this.Text;

	// Show a message box with Yes and No buttons
	ExceptionMessageBox box = new ExceptionMessageBox(exTop,
		ExceptionMessageBoxButtons.YesNo,
		ExceptionMessageBoxSymbol.Question,
		ExceptionMessageBoxDefaultButton.Button2);

	// Enable the check box.
	box.ShowCheckBox = true;

	// Define the registry key to use.
	box.CheckBoxRegistryKey =
		Microsoft.Win32.Registry.CurrentUser.CreateSubKey(
		@"Software\TestApp");
	box.CheckBoxRegistryValue = "DontShowActionFailedMessage";
	box.CheckBoxRegistryMeansDoNotShowDialog = true;
	box.DefaultDialogResult = DialogResult.Yes;

	// The message box won't be displayed if the
	// "DontShowActionFailedMessage" value of the registry key 
	// contains a non-zero value.
	if (box.Show(this) == DialogResult.No)
	{
		// Do something if the user clicks the No button.
		this.Close();
	}
}
Try
    ' Do something that could generate an exception.
    Throw New ApplicationException("An error has occured.")
Catch ex As ApplicationException
    Dim str As String = "The action failed. Do you want to continue?"
    Dim exTop As ApplicationException = New ApplicationException(str, ex)
    exTop.Source = Me.Text

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

    ' Enable the check box.
    box.ShowCheckBox = True

    ' Define the registry key to use.
    box.CheckBoxRegistryKey = _
    Microsoft.Win32.Registry.CurrentUser.CreateSubKey( _
     "Software\TestApp")
    box.CheckBoxRegistryValue = "DontShowActionFailedMessage"
    box.CheckBoxRegistryMeansDoNotShowDialog = True
    box.DefaultDialogResult = Windows.Forms.DialogResult.Yes

    ' The message box won't be displayed if the
    ' "DontShowActionFailedMessage" value of the registry key 
    ' contains a non-zero value.
    If box.Show(Me) = Windows.Forms.DialogResult.No Then
        ' Do something if the user clicks the No button.
        Me.Close()
    End If
End Try

설명

이 속성은 함께 사용 CheckBoxRegistryValue 확인란의 선택 된 상태를 초기화 합니다.This property is used with CheckBoxRegistryValue to initialize the selected state of the check box. 존재 하 고 0이 아닌 값을 포함 하는 지정된 된 레지스트리 값을 확인란으로 표시 됩니다; 선택한 그렇지 않은 경우 확인란 선택을 취소로 표시 됩니다.If the specified registry value exists and contains a non-zero value, the check box is displayed as selected; otherwise, the check box is displayed as clear. 경우 CheckBoxRegistryMeansDoNotShowDialogtrue 레지스트리 값이 있고 0이 아닌 값이 포함 되어 있으면 메시지 상자가 표시 되지 않습니다 및 및 ExceptionMessageBox 반환 DefaultDialogResultShow 라고 합니다.If CheckBoxRegistryMeansDoNotShowDialog is true and the registry value exists and contains a non-zero value, the message box is not displayed and ExceptionMessageBox returns DefaultDialogResult when Show is called.

RegistryKey 호출 하기 전에 응용 프로그램에서 열려 있어야 Show합니다.The RegistryKey must be opened by the application prior to calling Show.

적용 대상