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 MsgBoxStyle

Member nameDescription
Supported by the .NET Compact FrameworkOkOnlyOK button only (default). This member is equivalent to the Visual Basic constant vbOKOnly.
Supported by the .NET Compact FrameworkOkCancelOK and Cancel buttons. This member is equivalent to the Visual Basic constant vbOKCancel.
Supported by the .NET Compact FrameworkAbortRetryIgnoreAbort, Retry, and Ignore buttons. This member is equivalent to the Visual Basic constant vbAbortRetryIgnore.
Supported by the .NET Compact FrameworkYesNoCancelYes, No, and Cancel buttons. This member is equivalent to the Visual Basic constant vbYesNoCancel.
Supported by the .NET Compact FrameworkYesNoYes and No buttons. This member is equivalent to the Visual Basic constant vbYesNo.
Supported by the .NET Compact FrameworkRetryCancelRetry and Cancel buttons. This member is equivalent to the Visual Basic constant vbRetryCancel.
Supported by the .NET Compact FrameworkCriticalCritical message. This member is equivalent to the Visual Basic constant vbCritical.
Supported by the .NET Compact FrameworkQuestionWarning query. This member is equivalent to the Visual Basic constant vbQuestion.
Supported by the .NET Compact FrameworkExclamationWarning message. This member is equivalent to the Visual Basic constant vbExclamation.
Supported by the .NET Compact FrameworkInformationInformation message. This member is equivalent to the Visual Basic constant vbInformation.
Supported by the .NET Compact FrameworkDefaultButton1First button is default. This member is equivalent to the Visual Basic constant vbDefaultButton1.
Supported by the .NET Compact FrameworkDefaultButton2Second button is default. This member is equivalent to the Visual Basic constant vbDefaultButton2.
Supported by the .NET Compact FrameworkDefaultButton3Third button is default. This member is equivalent to the Visual Basic constant vbDefaultButton3.
Supported by the .NET Compact FrameworkApplicationModalApplication modal message box. This member is equivalent to the Visual Basic constant vbApplicationModal.
Supported by the .NET Compact FrameworkSystemModalSystem modal message box. This member is equivalent to the Visual Basic constant vbSystemModal.
Supported by the .NET Compact FrameworkMsgBoxHelpHelp text. This member is equivalent to the Visual Basic constant vbMsgBoxHelp.
Supported by the .NET Compact FrameworkMsgBoxRightRight-aligned text. This member is equivalent to the Visual Basic constant vbMsgBoxRight.
Supported by the .NET Compact FrameworkMsgBoxRtlReadingRight-to-left reading text (Hebrew and Arabic systems). This member is equivalent to the Visual Basic constant vbMsgBoxRtlReading.
Supported by the .NET Compact FrameworkMsgBoxSetForegroundForeground message box window. This member is equivalent to the Visual Basic constant vbMsgBoxSetForeground.
Supported by the .NET Compact FrameworkOKOnly
Supported by the .NET Compact FrameworkOKCancel

For more detailed information, see the Visual Basic topic MsgBoxStyle Enumeration.

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.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

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

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 3.5, 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft