MsgBoxStyle MsgBoxStyle MsgBoxStyle MsgBoxStyle Enum

定义

指示调用 MsgBox 函数时显示的按钮。Indicates which buttons to display when calling the MsgBox function.

此枚举有一个 FlagsAttribute 属性,允许按位组合成员值。

public enum class MsgBoxStyle
[System.Flags]
public enum MsgBoxStyle
type MsgBoxStyle = 
Public Enum MsgBoxStyle
继承
属性

字段

AbortRetryIgnore AbortRetryIgnore AbortRetryIgnore AbortRetryIgnore 2

“中止”、“重试”和“忽略”按钮。Abort, Retry, and Ignore buttons. 此成员等效于 Visual Basic 常量 vbAbortRetryIgnoreThis member is equivalent to the Visual Basic constant vbAbortRetryIgnore.

ApplicationModal ApplicationModal ApplicationModal ApplicationModal 0

应用程序模式消息框。Application modal message box. 此成员等效于 Visual Basic 常量 vbApplicationModalThis member is equivalent to the Visual Basic constant vbApplicationModal.

Critical Critical Critical Critical 16

关键消息。Critical message. 此成员等效于 Visual Basic 常量 vbCriticalThis member is equivalent to the Visual Basic constant vbCritical.

DefaultButton1 DefaultButton1 DefaultButton1 DefaultButton1 0

第一个按钮是默认值。First button is default. 此成员等效于 Visual Basic 常量 vbDefaultButton1This member is equivalent to the Visual Basic constant vbDefaultButton1.

DefaultButton2 DefaultButton2 DefaultButton2 DefaultButton2 256

第二个按钮是默认值。Second button is default. 此成员等效于 Visual Basic 常量 vbDefaultButton2This member is equivalent to the Visual Basic constant vbDefaultButton2.

DefaultButton3 DefaultButton3 DefaultButton3 DefaultButton3 512

第三个按钮是默认值。Third button is default. 此成员等效于 Visual Basic 常量 vbDefaultButton3This member is equivalent to the Visual Basic constant vbDefaultButton3.

Exclamation Exclamation Exclamation Exclamation 48

警告消息。Warning message. 此成员等效于 Visual Basic 常量 vbExclamationThis member is equivalent to the Visual Basic constant vbExclamation.

Information Information Information Information 64

信息消息。Information message. 此成员等效于 Visual Basic 常量 vbInformationThis member is equivalent to the Visual Basic constant vbInformation.

MsgBoxHelp MsgBoxHelp MsgBoxHelp MsgBoxHelp 16384

帮助文本。Help text. 此成员等效于 Visual Basic 常量 vbMsgBoxHelpThis member is equivalent to the Visual Basic constant vbMsgBoxHelp.

MsgBoxRight MsgBoxRight MsgBoxRight MsgBoxRight 524288

右对齐文本。Right-aligned text. 此成员等效于 Visual Basic 常量 vbMsgBoxRightThis member is equivalent to the Visual Basic constant vbMsgBoxRight.

MsgBoxRtlReading MsgBoxRtlReading MsgBoxRtlReading MsgBoxRtlReading 1048576

从右到左阅读的文本(希伯来语和阿拉伯语系统)。Right-to-left reading text (Hebrew and Arabic systems). 此成员等效于 Visual Basic 常量 vbMsgBoxRtlReadingThis member is equivalent to the Visual Basic constant vbMsgBoxRtlReading.

MsgBoxSetForeground MsgBoxSetForeground MsgBoxSetForeground MsgBoxSetForeground 65536

前景消息框窗口。Foreground message box window. 此成员等效于 Visual Basic 常量 vbMsgBoxSetForegroundThis member is equivalent to the Visual Basic constant vbMsgBoxSetForeground.

OkCancel OkCancel OkCancel OkCancel 1

“确定”和“取消”按钮。OK and Cancel buttons. 此成员等效于 Visual Basic 常量 vbOKCancelThis member is equivalent to the Visual Basic constant vbOKCancel.

OKCancel OKCancel OKCancel OKCancel 1
OkOnly OkOnly OkOnly OkOnly 0

仅“确定”按钮(默认)。OK button only (default). 此成员等效于 Visual Basic 常量 vbOKOnlyThis member is equivalent to the Visual Basic constant vbOKOnly.

OKOnly OKOnly OKOnly OKOnly 0
Question Question Question Question 32

警告查询。Warning query. 此成员等效于 Visual Basic 常量 vbQuestionThis member is equivalent to the Visual Basic constant vbQuestion.

RetryCancel RetryCancel RetryCancel RetryCancel 5

“重试”和“取消”按钮。Retry and Cancel buttons. 此成员等效于 Visual Basic 常量 vbRetryCancelThis member is equivalent to the Visual Basic constant vbRetryCancel.

SystemModal SystemModal SystemModal SystemModal 4096

系统模式消息框。System modal message box. 此成员等效于 Visual Basic 常量 vbSystemModalThis member is equivalent to the Visual Basic constant vbSystemModal.

YesNo YesNo YesNo YesNo 4

“是”和“否”按钮。Yes and No buttons. 此成员等效于 Visual Basic 常量 vbYesNoThis member is equivalent to the Visual Basic constant vbYesNo.

YesNoCancel YesNoCancel YesNoCancel YesNoCancel 3

“是”、“否”和“取消”按钮。Yes, No, and Cancel buttons. 此成员等效于 Visual Basic 常量 vbYesNoCancelThis member is equivalent to the Visual Basic constant vbYesNoCancel.

注解

当您调用MsgBox函数,可以使用MsgBoxStyle代替实际值在代码中的枚举。When you call the MsgBox function, you can use the MsgBoxStyle enumeration in your code in place of the actual values. Buttons参数采用MsgBoxStyle枚举成员。The Buttons argument takes the MsgBoxStyle enumeration members.

适用于

另请参阅