ExceptionMessageBox Constructor (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.

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

public ExceptionMessageBox(
	string text,
	string caption,
	ExceptionMessageBoxButtons buttons,
	ExceptionMessageBoxSymbol symbol,
	ExceptionMessageBoxDefaultButton defaultButton
)

Parameters

text
Type: System.String

Error text of the top-level message.

caption
Type: System.String

Dialog box caption of the exception message box.

buttons
Type: Microsoft.SqlServer.MessageBox.ExceptionMessageBoxButtons

ExceptionMessageBoxButtons enumeration that specifies the buttons to display in the exception message box.

symbol
Type: Microsoft.SqlServer.MessageBox.ExceptionMessageBoxSymbol

ExceptionMessageBoxSymbol enumeration that specifies the symbol to display in the exception message box.

defaultButton
Type: Microsoft.SqlServer.MessageBox.ExceptionMessageBoxDefaultButton

ExceptionMessageBoxDefaultButton enumeration that specifies the default button for the exception message box.

// Define the message and caption to display.
string str = @"Are you sure you want to delete file 'c:\somefile.txt'?";
string caption = "Confirm File Deletion";

// Show the exception message box with Yes and No buttons.
ExceptionMessageBox box = new ExceptionMessageBox(str,
	caption, ExceptionMessageBoxButtons.YesNo,
	ExceptionMessageBoxSymbol.Question,
	ExceptionMessageBoxDefaultButton.Button2);

if (DialogResult.Yes == box.Show(this))
{
	// Delete the file.
}
Return to top
Show: