MsgBoxStyle Enumeration

Indicates which buttons to display when calling the MsgBox function.

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.

Members

Member

Constant

Description

OKOnly

vbOKOnly

OK button only (default).

OKCancel

vbOKCancel

OK and Cancel buttons.

AbortRetryIgnore

vbAbortRetryIgnore

Abort, Retry, and Ignore buttons.

YesNoCancel

vbYesNoCancel

Yes, No, and Cancel buttons.

YesNo

vbYesNo

Yes and No buttons.

RetryCancel

vbRetryCancel

Retry and Cancel buttons.

Critical

vbCritical

Critical message.

Question

vbQuestion

Warning query.

Exclamation

vbExclamation

Warning message.

Information

vbInformation

Information message.

DefaultButton1

vbDefaultButton1

First button is default.

DefaultButton2

vbDefaultButton2

Second button is default.

DefaultButton3

vbDefaultButton3

Third button is default.

ApplicationModal

vbApplicationModal

Application modal message box.

SystemModal

vbSystemModal

System modal message box.

MsgBoxSetForeground

vbMsgBoxSetForeground

Foreground message box window.

MsgBoxRight

vbMsgBoxRight

Right-aligned text.

MsgBoxRtlReading

vbMsgBoxRtlReading

Right-to-left reading text (Hebrew and Arabic systems).

MsgBoxHelp

vbMsgBoxHelp

Help text.

Requirements

Namespace: Microsoft.VisualBasic

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

See Also

Tasks

How to: Refer to an Enumeration Member

Concepts

Intrinsic Constants and Enumerations

When to Use an Enumeration

Reference

MsgBoxResult Enumeration

MsgBox Function (Visual Basic)