MsgBox Method

The MsgBox method displays a message in a dialog box.

Syntax

MsgBox(prompt, [buttons], [title])

Parameters

prompt

Required. String displayed as the message in the dialog box.

buttons

Optional. Numeric expression that is the sum of values specifying the number and type of buttons to display, the icon style to use and the identity of the default button. If omitted, the default value for buttons is 0.

Constant Description
0 Display OK button only.
1 Display OK and Cancel buttons.
2 Display Abort, Retry and Ignore buttons.
3 Display Yes, No and Cancel buttons.
4 Display Yes and No buttons.
5 Display Retry and Cancel buttons.
6 Display Cancel, Try Again and Continue buttons.
7 Display Continue and Abort buttons.
16 Display error message icon.
32 Display query message icon.
48 Display warning message icon.
64 Display information message icon.
0 First button is default.
256 Second button is default.
512 Third button is default.
768 Fourth button is default.

title

Optional. String displayed in the title bar of the dialog box.

Return Values

Value Description
1 OK
2 Cancel
3 Abort
4 Retry
5 Ignore
6 Yes
7 No
10 Try Again
11 Continue

See Also

Salamander Object