MsgBoxStyle MsgBoxStyle MsgBoxStyle MsgBoxStyle Enum

Definition

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.

public enum class MsgBoxStyle
[System.Flags]
public enum MsgBoxStyle
type MsgBoxStyle = 
Public Enum MsgBoxStyle
Inheritance
Attributes

Fields

AbortRetryIgnore AbortRetryIgnore AbortRetryIgnore AbortRetryIgnore 2

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

ApplicationModal ApplicationModal ApplicationModal ApplicationModal 0

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

Critical Critical Critical Critical 16

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

DefaultButton1 DefaultButton1 DefaultButton1 DefaultButton1 0

First button is default. This member is equivalent to the Visual Basic constant vbDefaultButton1.

DefaultButton2 DefaultButton2 DefaultButton2 DefaultButton2 256

Second button is default. This member is equivalent to the Visual Basic constant vbDefaultButton2.

DefaultButton3 DefaultButton3 DefaultButton3 DefaultButton3 512

Third button is default. This member is equivalent to the Visual Basic constant vbDefaultButton3.

Exclamation Exclamation Exclamation Exclamation 48

Warning message. This member is equivalent to the Visual Basic constant vbExclamation.

Information Information Information Information 64

Information message. This member is equivalent to the Visual Basic constant vbInformation.

MsgBoxHelp MsgBoxHelp MsgBoxHelp MsgBoxHelp 16384

Help text. This member is equivalent to the Visual Basic constant vbMsgBoxHelp.

MsgBoxRight MsgBoxRight MsgBoxRight MsgBoxRight 524288

Right-aligned text. This member is equivalent to the Visual Basic constant vbMsgBoxRight.

MsgBoxRtlReading MsgBoxRtlReading MsgBoxRtlReading MsgBoxRtlReading 1048576

Right-to-left reading text (Hebrew and Arabic systems). This member is equivalent to the Visual Basic constant vbMsgBoxRtlReading.

MsgBoxSetForeground MsgBoxSetForeground MsgBoxSetForeground MsgBoxSetForeground 65536

Foreground message box window. This member is equivalent to the Visual Basic constant vbMsgBoxSetForeground.

OkCancel OkCancel OkCancel OkCancel 1

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

OKCancel OKCancel OKCancel OKCancel 1
OkOnly OkOnly OkOnly OkOnly 0

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

OKOnly OKOnly OKOnly OKOnly 0
Question Question Question Question 32

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

RetryCancel RetryCancel RetryCancel RetryCancel 5

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

SystemModal SystemModal SystemModal SystemModal 4096

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

YesNo YesNo YesNo YesNo 4

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

YesNoCancel YesNoCancel YesNoCancel YesNoCancel 3

Yes, No, and Cancel buttons. This member is equivalent to the Visual Basic constant vbYesNoCancel.

Remarks

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.

Applies to

See also