|
|
(6 intermediate revisions by 4 users not shown) |
Line 3: |
Line 3: |
| == Description == | | == Description == |
|
| |
|
| MsgBox opens a dialog box, and waits for the user to tap on a button. The return value is an integer that indicates which button was tapped. The required parameter, ''prompt'', is a string expression that is displayed in the body of the dialog box. The optional parameter, ''okCancel'', is a numeric or constant expression that specifies whether to ask the user to choose between a Cancel and Ok. The default value for ''okCancel'' is 0. | | MsgBox opens a [[NSB.MsgBox]], and waits for the user to tap on a button. |
|
| |
|
| '''Table 15: okcancel constants'''
| |
|
| |
| {| class="wikitable"
| |
| |-
| |
| ! Constant !! Value !! Description
| |
| |-
| |
| | vbOKOnly || 0 || OK Button only
| |
| |-
| |
| | vbOKCancel || 1 || OK and Cancel Buttons
| |
| |}
| |
|
| |
| '''Table 16: MSGBOX return values'''
| |
|
| |
| {| class="wikitable"
| |
| |-
| |
| ! Constant !! Value !! Description
| |
| |-
| |
| | vbOK || 1 || OK
| |
| |-
| |
| | vbCancel || 2 || Cancel
| |
| |}
| |
|
| |
| == Example ==
| |
|
| |
| <pre>
| |
| Rem MsgBox Example
| |
| 'MsgBox displays a modal dialog box
| |
| Dim Continue
| |
| MsgBox("Hello World!")
| |
| MsgBox "Brief tour of MSGBOX", vbOK
| |
| Continue = MsgBox("Continue tour?", 1)
| |
| If Continue = vbYes Then
| |
| Continue=MsgBox("Short tour, huh?")
| |
| END IF
| |
| Continue = MSGBOX("Repeat tour?", 1)
| |
| IF Continue = vbCancel THEN
| |
| MSGBOX("Goodbye!")
| |
| End If
| |
| </pre>
| |
|
| |
| == Output ==
| |
|
| |
| [[MSGBOX:MSGBOX.jpg]]
| |
|
| |
|
| == Related Items == | | == Related Items == |
|
| |
|
| [[inputbox|INPUTBOX]] | | [[inputbox|InputBox]] |
|
| |
|
| [[Category:Language Reference]] | | [[Category:Language Reference]] |
| | |
| | [[Category:Messages]] |
Latest revision as of 12:12, 31 December 2013
MsgBox(prompt[, okCancel])
Description
MsgBox opens a NSB.MsgBox, and waits for the user to tap on a button.
Related Items
InputBox