Export (0) Print
Expand All

MsgBoxStyle Enumeration

Indicates which buttons to display when calling the MsgBox function.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace:  Microsoft.VisualBasic
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

[FlagsAttribute]
public enum class MsgBoxStyle

Member nameDescription
AbortRetryIgnoreAbort, Retry, and Ignore buttons. This member is equivalent to the Visual Basic constant vbAbortRetryIgnore.
ApplicationModalApplication modal message box. This member is equivalent to the Visual Basic constant vbApplicationModal.
CriticalCritical message. This member is equivalent to the Visual Basic constant vbCritical.
DefaultButton1First button is default. This member is equivalent to the Visual Basic constant vbDefaultButton1.
DefaultButton2Second button is default. This member is equivalent to the Visual Basic constant vbDefaultButton2.
DefaultButton3Third button is default. This member is equivalent to the Visual Basic constant vbDefaultButton3.
ExclamationWarning message. This member is equivalent to the Visual Basic constant vbExclamation.
InformationInformation message. This member is equivalent to the Visual Basic constant vbInformation.
MsgBoxHelpHelp text. This member is equivalent to the Visual Basic constant vbMsgBoxHelp.
MsgBoxRightRight-aligned text. This member is equivalent to the Visual Basic constant vbMsgBoxRight.
MsgBoxRtlReadingRight-to-left reading text (Hebrew and Arabic systems). This member is equivalent to the Visual Basic constant vbMsgBoxRtlReading.
MsgBoxSetForegroundForeground message box window. This member is equivalent to the Visual Basic constant vbMsgBoxSetForeground.
OkCancelOK and Cancel buttons. This member is equivalent to the Visual Basic constant vbOKCancel.
OkOnlyOK button only (default). This member is equivalent to the Visual Basic constant vbOKOnly.
QuestionWarning query. This member is equivalent to the Visual Basic constant vbQuestion.
RetryCancelRetry and Cancel buttons. This member is equivalent to the Visual Basic constant vbRetryCancel.
SystemModalSystem modal message box. This member is equivalent to the Visual Basic constant vbSystemModal.
YesNoYes and No buttons. This member is equivalent to the Visual Basic constant vbYesNo.
YesNoCancelYes, No, and Cancel buttons. This member is equivalent to the Visual Basic constant vbYesNoCancel.

When you call the MsgBox function, you can use the MsgBoxStyle enumeration in your code in place of the actual values. The Buttons argument takes the MsgBoxStyle enumeration members.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft