ExceptionMessageBox Class

ExceptionMessageBox Class

 

Displays a message box that can be customized with text, buttons, and symbols to improve the customer experience with a Microsoft Windows .NET Framework-based application.

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

System.Object
  Microsoft.SqlServer.MessageBox.ExceptionMessageBox

[ComVisibleAttribute(false)]
public class ExceptionMessageBox

NameDescription
System_CAPS_pubmethodExceptionMessageBox()

Creates an instance of ExceptionMessageBox with the default properties.

System_CAPS_pubmethodExceptionMessageBox(Exception)

Creates an instance of ExceptionMessageBox by using information from the specified Exception.

System_CAPS_pubmethodExceptionMessageBox(Exception, ExceptionMessageBoxButtons)

Creates an instance of ExceptionMessageBox by using information from the specified Exception and by specifying the buttons to display in the message box.

System_CAPS_pubmethodExceptionMessageBox(Exception, ExceptionMessageBoxButtons, ExceptionMessageBoxSymbol)

Creates an instance of ExceptionMessageBox by using information from the specified Exception and by specifying the buttons and symbol to display in the message box.

System_CAPS_pubmethodExceptionMessageBox(Exception, ExceptionMessageBoxButtons, ExceptionMessageBoxSymbol, ExceptionMessageBoxDefaultButton)

Creates an instance of ExceptionMessageBox by using information from the specified Exception and by specifying the buttons, symbol, and default button to display in the exception message box. .

System_CAPS_pubmethodExceptionMessageBox(Exception, ExceptionMessageBoxButtons, ExceptionMessageBoxSymbol, ExceptionMessageBoxDefaultButton, ExceptionMessageBoxOptions)

Creates an instance of ExceptionMessageBox by using information from the specified Exception and by specifying the buttons, symbol, default button, and other properties to display in the exception message box.

System_CAPS_pubmethodExceptionMessageBox(String)

Creates an instance of ExceptionMessageBox with the supplied top-level error message text.

System_CAPS_pubmethodExceptionMessageBox(String, String)

Creates an instance of ExceptionMessageBox with the supplied top-level error message text and the dialog box caption of the exception message box.

System_CAPS_pubmethodExceptionMessageBox(String, String, ExceptionMessageBoxButtons)

Creates an instance of ExceptionMessageBox with the supplied top-level error message text and the dialog box caption of the exception message box. The method also specifies buttons to display in the exception message box.

System_CAPS_pubmethodExceptionMessageBox(String, String, ExceptionMessageBoxButtons, ExceptionMessageBoxSymbol)

Creates an instance of ExceptionMessageBox with the supplied top-level error message text and dialog box caption of the exception message box. The method also specifies the buttons and symbol to display in the exception message box.

System_CAPS_pubmethodExceptionMessageBox(String, String, ExceptionMessageBoxButtons, ExceptionMessageBoxSymbol, ExceptionMessageBoxDefaultButton)

Creates an instance of ExceptionMessageBox with the supplied top-level error message text and dialog box caption of the message box. The method also specifies the buttons, symbol, and default button to display in the exception message box.

System_CAPS_pubmethodExceptionMessageBox(String, String, ExceptionMessageBoxButtons, ExceptionMessageBoxSymbol, ExceptionMessageBoxDefaultButton, ExceptionMessageBoxOptions)

This API supports the product infrastructure and is not intended to be used directly from your code. Creates an instance of ExceptionMessageBox with the supplied top-level error message text and dialog box caption of the message box. The method also specifies the buttons, symbol, default button, and dialog options to display in the exception message box.

NameDescription
System_CAPS_pubpropertySystem_CAPS_staticAbortButtonText

Gets the default text for the Abort button.

System_CAPS_pubpropertyBeep

Specifies whether to play an audible sound when the message is displayed.

System_CAPS_pubpropertyButtons

Gets or sets the buttons to display in the message box.

System_CAPS_pubpropertySystem_CAPS_staticCancelButtonText

Gets the default text for the Cancel button.

System_CAPS_pubpropertyCaption

Gets or sets the dialog box caption of the exception message box.

System_CAPS_pubpropertyCheckBoxRegistryKey

Sets an opened RegistryKey that controls the check box that is displayed on the exception message box when P:Microsoft.SqlServer.MessageBox.ExceptionMessageBox.ShowCheckbox is true.

System_CAPS_pubpropertyCheckBoxRegistryMeansDoNotShowDialog

Determines whether the registry value content specified by CheckBoxRegistryKey and CheckBoxRegistryValue indicates a previous user decision not to view this message.

System_CAPS_pubpropertyCheckBoxRegistryValue

Gets or sets the registry value name that controls the check box on the exception message box when P:Microsoft.SqlServer.MessageBox.ExceptionMessageBox.ShowCheckbox is true.

System_CAPS_pubpropertyCheckBoxText

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.

System_CAPS_pubpropertyCustomDialogResult

Gets the clicked custom text dialog button.

System_CAPS_pubpropertyCustomSymbol

Gets or sets a custom bitmap to use as the symbol on the exception message box.

System_CAPS_pubpropertyData

Gets the IDictionary interface that stores help link and advanced information associated with the top-level message.

System_CAPS_pubpropertyDefaultButton

Gets or sets the default button on the message box.

System_CAPS_pubpropertyDefaultDialogResult

Gets or sets the value returned by the Show method when the user has previously indicated not to show a given message again.

System_CAPS_pubpropertySystem_CAPS_staticFailButtonText

Gets the default text for the Fail button.

System_CAPS_pubpropertyFont

Gets or sets the font used in the message box.

System_CAPS_pubpropertyHelpLink

Gets or sets the link to the help file or help Web page associated with the top-level message.

System_CAPS_pubpropertySystem_CAPS_staticIgnoreButtonText

Gets the default text for the Ignore button.

System_CAPS_pubpropertyInnerException

Gets or sets the Exception instance associated with the lower-level message(s).

System_CAPS_pubpropertyIsCheckBoxChecked

Specifies whether the check box is selected when P:Microsoft.SqlServer.MessageBox.ExceptionMessageBox.ShowCheckbox is true.

System_CAPS_pubpropertyMessage

Gets or sets the Exception that contains the message to display.

System_CAPS_pubpropertyMessageLevelDefault

Gets or sets the number of message levels to display in the message box.

System_CAPS_pubpropertySystem_CAPS_staticNoButtonText

Gets the default text for the No button

System_CAPS_pubpropertySystem_CAPS_staticOKButtonText

Gets the default text for the OK button

System_CAPS_pubpropertyOptions

Gets or sets miscellaneous display options for the message box

System_CAPS_pubpropertySystem_CAPS_staticRetryButtonText

Gets the default text for the Retry button.

System_CAPS_pubpropertyShowCheckBox

Specifies whether to show the check box in the exception message box.

System_CAPS_pubpropertyShowToolBar

Specifies whether to show the command button toolbar on the exception message box.

System_CAPS_pubpropertySymbol

Gets or sets the symbol to display in the exception message box.

System_CAPS_pubpropertyText

Gets or sets the text of the top-level message to display in the exception message box

System_CAPS_pubpropertyUseOwnerFont

Specifies whether to retrieve the font of the owner window and use it as the font for the exception message box.

System_CAPS_pubpropertySystem_CAPS_staticYesButtonText

Gets the default text for the Yes button

NameDescription
System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodSystem_CAPS_staticGetMessageText(Exception)

Returns the string that a user can copy to the clipboard when the exception is displayed in an exception message box.

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodSetButtonText(String)

Sets the text for the custom text button when only one button is displayed in the exception message box.

System_CAPS_pubmethodSetButtonText(String, String)

Sets the text for the custom text buttons when only two buttons are displayed in the exception message box.

System_CAPS_pubmethodSetButtonText(String, String, String)

Sets the text for the custom text buttons when only three buttons are displayed in the exception message box.

System_CAPS_pubmethodSetButtonText(String, String, String, String)

Sets the text for the custom text buttons when only four buttons are displayed in the exception message box.

System_CAPS_pubmethodSetButtonText(String, String, String, String, String)

Sets the text for the custom text buttons when only five buttons are displayed in the exception message box.

System_CAPS_pubmethodShow(IntPtr, String, String, String, String, String, String, String)

Displays the exception message box. Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.

System_CAPS_pubmethodShow(IWin32Window)

Shows the exception message box as a modal dialog box centered on the parent window.

System_CAPS_pubmethodToString()

(Inherited from Object.)

NameDescription
System_CAPS_pubeventOnCopyToClipboard

Occurs when exception message text is copied from the message box to the Clipboard.

Legacy Code Example

This example displays the message box with an OK button.

try
{
	// Do something that may generate an exception.
	throw new ApplicationException("An error has occured");
}
catch (ApplicationException ex)
{
	// Define a new top-level error message.
	string str = "The action failed.";

	// Add the new top-level message to the handled exception.
	ApplicationException exTop = new ApplicationException(str, ex);
	exTop.Source = this.Text;

	// Show an exception message box with an OK button (the default).
	ExceptionMessageBox box = new ExceptionMessageBox(exTop);
	box.Show(this);
}

This example uses the exception message box to show additional information that is helpful when troubleshooting or debugging.

try
{
	// Do something that you don't expect to generate an exception.
	throw new ApplicationException("Failed to connect to the server.");
}
catch (ApplicationException ex)
{
	string str = "An unexpected error occurred. Please call Helpdesk.";
	ApplicationException exTop = new ApplicationException(str, ex);
	exTop.Source = this.Text;

	// Information in the Data property of an exception that has a name
	// beginning with "HelpLink.Advanced" is shown when the user
	// clicks the Advanced Information button of the exception message
	// box dialog box.
	exTop.Data.Add("AdvancedInformation.FileName", "application.dll");
	exTop.Data.Add("AdvancedInformation.FilePosition", "line 355");
	exTop.Data.Add("AdvancedInformation.UserContext", "single user mode");

	// Show the exception message box with additional information that 
	// is helpful when a user calls technical support.
	ExceptionMessageBox box = new ExceptionMessageBox(exTop);

	box.Show(this);
}

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft