IBM Lotus Symphony
|
显示一个包含消息的对话框。
MsgBox Text As String [,Type As Integer [,Dialogtitle As String]] (As Statement) or MsgBox (Text As String [,Type As Integer [,Dialogtitle As String]]) (As Function)
Text:字符串表达式,在对话框中显示为消息。使用 Chr$(13) 可以插入换行符。
DialogTitle:字符串表达式,在对话框的标题栏中显示。如果省略此参数,标题栏将显示相应的应用程序名称。
Type:任意整型表达式,用于指定对话框类型、要显示的按钮的数目和类型,以及图标类型。Type 表示位模式组合,即通过添加各自值而定义的元素的组合:
0:仅显示“确定”按钮。
1:显示“确定”和“取消”按钮。
2:显示“中止”、“重试”和“忽略”按钮。
3:显示“是”、“否”和“取消”按钮。
4:显示“是”和“否”按钮。
5:显示“重试”和“取消”按钮。
16:在对话框中添加“停止”图标。
32:在对话框中添加“问号”图标。
48:在对话框中添加“说明”图标。
64:在对话框中添加“信息”图标。
128:将对话框中的第一个按钮作为缺省按钮。
256:将对话框中的第二个按钮作为缺省按钮。
512:将对话框中的第三个按钮作为缺省按钮。
Sub ExampleMsgBox
Const sText1 = "An unexpected error occurred."
Const sText2 = "The program execution will continue, however."
Const sText3 = "Error"
MsgBox(sText1 + Chr(13) + sText2,16,sText3)
End If