MsgBoxStyle 枚举

定义

指示调用 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
继承
MsgBoxStyle
属性

字段

AbortRetryIgnore 2

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

ApplicationModal 0

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

Critical 16

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

DefaultButton1 0

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

DefaultButton2 256

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

DefaultButton3 512

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

Exclamation 48

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

Information 64

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

MsgBoxHelp 16384

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

MsgBoxRight 524288

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

MsgBoxRtlReading 1048576

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

MsgBoxSetForeground 65536

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

OkCancel 1

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

OKCancel 1
OkOnly 0

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

OKOnly 0
Question 32

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

RetryCancel 5

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

SystemModal 4096

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

YesNo 4

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

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.

适用于

另请参阅