MsgBoxResult是枚举类型,你必须引用具体的枚举值。
比如MsgBoxResult.OK
通常这样用:
if msgbox("ok",MsgBoxStyle.Critical,"title")=MsgBoxResult.OK then
'按OK按钮的处理
else
'按其他按钮的处理
end if
dim a as integer
a=msgbox("ok",16+0,"title")
console.writeline(a.tostring)
a=msgbox("ok",32+1,"title")
console.writeline(a.tostring)
a=msgbox("ok",48+2,"title")
console.writeline(a.tostring)
The MsgBox function creates a dialog box with a specified message and prompts the user to click a button, upon which the dialog box closes and a value relating to which button was clicked is returned. These values, along with their Constants, are listed in the table below.
CONSTANT VALUE BUTTON
VBOK 1 OK
VBCancel 2 Cancel
VBAbort 3 Abort
VBRetry 4 Retry
VBIgnore 5 Ignore
VBYes 6 Yes
VBNo 7 No