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
AbortRetryIgnore

Abort, Retry, and Ignore buttons. This member is equivalent to the Visual Basic constant vbAbortRetryIgnore.

ApplicationModal

Application modal message box. This member is equivalent to the Visual Basic constant vbApplicationModal.

Critical

Critical message. This member is equivalent to the Visual Basic constant vbCritical.

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.

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.

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.

OkCancel

OK and Cancel buttons. This member is equivalent to the Visual Basic constant vbOKCancel.

OkOnly

OK button only (default). This member is equivalent to the Visual Basic constant vbOKOnly.

Question

Warning query. This member is equivalent to the Visual Basic constant vbQuestion.

RetryCancel

Retry and Cancel buttons. This member is equivalent to the Visual Basic constant vbRetryCancel.

SystemModal

System modal message box. This member is equivalent to the Visual Basic constant vbSystemModal.

YesNo

Yes and No buttons. This member is equivalent to the Visual Basic constant vbYesNo.

YesNoCancel

Yes, 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
Available since 1.1
Return to top
Show: