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.VisualBasicAssembly: Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)
| Member name | Description | |
|---|---|---|
![]() | OkOnly | OK button only (default). This member is equivalent to the Visual Basic constant vbOKOnly. |
![]() | OkCancel | OK and Cancel buttons. This member is equivalent to the Visual Basic constant vbOKCancel. |
![]() | AbortRetryIgnore | Abort, Retry, and Ignore buttons. This member is equivalent to the Visual Basic constant vbAbortRetryIgnore. |
![]() | YesNoCancel | Yes, No, and Cancel buttons. This member is equivalent to the Visual Basic constant vbYesNoCancel. |
![]() | YesNo | Yes and No buttons. This member is equivalent to the Visual Basic constant vbYesNo. |
![]() | RetryCancel | Retry and Cancel buttons. This member is equivalent to the Visual Basic constant vbRetryCancel. |
![]() | Critical | Critical message. This member is equivalent to the Visual Basic constant vbCritical. |
![]() | Question | Warning query. This member is equivalent to the Visual Basic constant vbQuestion. |
![]() | Exclamation | Warning message. This member is equivalent to the Visual Basic constant vbExclamation. |
![]() | Information | Information message. This member is equivalent to the Visual Basic constant vbInformation. |
![]() | DefaultButton1 | First button is default. This member is equivalent to the Visual Basic constant vbDefaultButton1. |
![]() | DefaultButton2 | Second button is default. This member is equivalent to the Visual Basic constant vbDefaultButton2. |
![]() | DefaultButton3 | Third button is default. This member is equivalent to the Visual Basic constant vbDefaultButton3. |
![]() | ApplicationModal | Application modal message box. This member is equivalent to the Visual Basic constant vbApplicationModal. |
![]() | SystemModal | System modal message box. This member is equivalent to the Visual Basic constant vbSystemModal. |
![]() | MsgBoxHelp | Help text. This member is equivalent to the Visual Basic constant vbMsgBoxHelp. |
![]() | MsgBoxRight | Right-aligned text. This member is equivalent to the Visual Basic constant vbMsgBoxRight. |
![]() | MsgBoxRtlReading | Right-to-left reading text (Hebrew and Arabic systems). This member is equivalent to the Visual Basic constant vbMsgBoxRtlReading. |
![]() | MsgBoxSetForeground | Foreground message box window. This member is equivalent to the Visual Basic constant vbMsgBoxSetForeground. |
![]() | OKOnly | |
![]() | OKCancel |
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.
