ExceptionMessageBox.CheckBoxRegistryMeansDoNotShowDialog 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
CheckBoxRegistryKey 및 CheckBoxRegistryValue로 지정된 레지스트리 값 내용이 이 메시지를 보지 않겠다는 사용자의 이전 의사 결정을 나타내는지 여부를 확인합니다.
public:
property bool CheckBoxRegistryMeansDoNotShowDialog { bool get(); void set(bool value); };
public bool CheckBoxRegistryMeansDoNotShowDialog { get; set; }
member this.CheckBoxRegistryMeansDoNotShowDialog : bool with get, set
Public Property CheckBoxRegistryMeansDoNotShowDialog As Boolean
속성 값
Boolean 값입니다.
예제
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
설명
is, true
CheckBoxRegistryMeansDoNotShowDialog is true
및 레지스트리 값이 존재하고 0이 아닌 값이 포함된 경우 ShowCheckBox 예외 메시지 상자가 표시되지 않고 호출될 ExceptionMessageBox 때 Show 반환 DefaultDialogResult 됩니다.
이 속성은 일반적으로 true
확인란 텍스트가 "이 메시지를 다시 표시 안 함" 또는 유사한 메시지일 때입니다.