ExceptionMessageBox.CheckBoxText Property

 

Gets or sets the text to display in the check box on the exception message box when P:Microsoft.SqlServer.MessageBox.ExceptionMessageBox.ShowCheckbox is true.

Namespace:   Microsoft.SqlServer.MessageBox
Assembly:  Microsoft.ExceptionMessageBox (in Microsoft.ExceptionMessageBox.dll)

public string CheckBoxText { get; set; }

Property Value

Type: System.String

A String value.

The default value is "Do not show this message again".

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;
	}
}
Return to top
Show: