the not-so-droll VBScript pop-ups, 1/2
The Message Box DialogThe Message Box dialog is created using the VBScript MsgBox() function:
- prompt is a string to be displayed as a message to the user
- buttons is an integer representing the sum of values specifying the
- type of button group to display
- type of icon to display
- default button (accessible from keyboard ENTER key)
- modality of the dialog
these are fully illustrated in the table below
- title is a string to be displayed in the title bar
"My Message Box Title",
"My Message Box Message")
(4 + 0 + 0 + 0)
(4 + 32 + 256 + 0)
(5 + 16 + 0 + 0)
Values for the buttons Argument
As you can see, there are four groups of values. To achieve the dialog "look" for our application, we must take one value from each group and add them together. The resulting sum becomes our buttons argument.
Refer to the examples in the left column. Compare the buttons argument value and the resulting dialog to the table above.
The MsgBox() function returns an integer value that identifies which button was clicked by the user. The table on the left lists the return values associated with the seven available buttons. The table above lists the possible return values for each button group. We'll be discussing the use of return values later.
It is apparent that the MsgBox() function can be used for better looking Alert and Confirm dialogs. But what about Prompt dialogs?
Produced by Peter Belesis andAll Rights Reserved. Legal Notices.
Created: Nov. 18, 1998
Revised: Nov. 18, 1998