Click to Rate and Give Feedback
MSDN
MSDN Library
SQL Server
SQL Server 2008
Database Engine
Technical Reference
 ExceptionMessageBoxButtons Enumerat...

  Switch on low bandwidth view
Community Content
In this section
Statistics Annotations (0)
Other versions are also available for the following:
ExceptionMessageBoxButtons Enumeration

Specifies the button to display in the exception message box.

Namespace: Microsoft.SqlServer.MessageBox
Assembly: Microsoft.ExceptionMessageBox (in microsoft.exceptionmessagebox.dll)
Visual Basic (Declaration)
Public Enumeration ExceptionMessageBoxButtons
C#
public enum ExceptionMessageBoxButtons
C++
public enum class ExceptionMessageBoxButtons
J#
public enum ExceptionMessageBoxButtons
JScript
public enum ExceptionMessageBoxButtons
Member nameDescription
AbortRetryIgnoreDisplay the Abort, Retry, and Ignore buttons.
CustomDisplay buttons with custom button text.
OKDisplay the OK button.
OKCancelDisplay the OK and Cancel buttons.
RetryCancelDisplay the Retry and Cancel buttons.
YesNoDisplay Yes and No buttons.
YesNoCancelDisplay Yes, No, and Cancel buttons.

When you use Custom, you must call SetButtonText to set the button text before you show the message box. After the user dismisses the exception message box, call CustomDialogResult to determine which button the user clicked.


C#
// 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.
}
Visual Basic
' Define the message and caption to display.
Dim str As String = "Are you sure you want to delete file 'c:\somefile.txt'?"
Dim caption As String = "Confirm File Deletion"

' Show the exception message box with Yes and No buttons.
Dim box As ExceptionMessageBox = New ExceptionMessageBox(str, _
 caption, ExceptionMessageBoxButtons.YesNo, _
 ExceptionMessageBoxSymbol.Question, _
 ExceptionMessageBoxDefaultButton.Button2)

If Windows.Forms.DialogResult.Yes = box.Show(Me) Then
    ' Delete the file.
End If

Development Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server.

Target Platforms

For a list of the supported platforms, see Hardware and Software Requirements for Installing SQL Server.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker