ExceptionMessageBoxSymbol Enumeration

 

Specifies the symbol that is displayed in the exception message box.

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

public enum ExceptionMessageBoxSymbol

Member nameDescription
Asterisk

The system asterisk symbol.

Error

The system error symbol.

Exclamation

The system exclamation point symbol.

Hand

The system hand symbol.

Information

The system information symbol.

None

No symbol.

Question

The system question mark symbol.

Stop

The system stop sign symbol.

Warning

The system warning symbol.

Members of ExceptionMessageBoxSymbol are system-maintained graphic icons.

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