Msgbox() Function
MsgBox(Prompt, [Buttons as VbMsgBoxStyle], [Title], [HelpFile], [Context]))
Creates a message box that provides status information or handle simple yes/no inputs.
Example:
' declare as integer to store the result as a number.
Dim myAnswer as Integer
Msgbox "Hello World!", vbExclamation ' Displays with an OK button with the Exclimation icon
myAnswer = Msgbox("Are you sure?", vbOKCancel + vbQuestion) ' Displays with an OK and Cancel button with the Questionmark icon
myAnswer = Msgbox("Do you want to dance?", vbYesNo + vbQuestion + vbDefaultButton2) ' Displays with an Yes and No button with the Questionmark icon, and the 2nd button (the No button) is default.
Dim myAnswer as Integer
Msgbox "Hello World!", vbExclamation ' Displays with an OK button with the Exclimation icon
myAnswer = Msgbox("Are you sure?", vbOKCancel + vbQuestion) ' Displays with an OK and Cancel button with the Questionmark icon
myAnswer = Msgbox("Do you want to dance?", vbYesNo + vbQuestion + vbDefaultButton2) ' Displays with an Yes and No button with the Questionmark icon, and the 2nd button (the No button) is default.
For the [VbMsgBoxStyle] argument, you may combine different options from the groups below to style the messagebox.
Constant | Value | Description |
---|---|---|
vbOkOnly | 0 | Display OK button only. |
vbOkCancel | 1 | Display OK and Cancel buttons. |
vbAbortRetryIgnore | 2 | Display Abort, Retry, and Ignore buttons. |
vbYesNoCancel | 3 | Display Yes, No, and Cancel buttons. |
vbYesNo | 4 | Display Yes and No buttons. |
vbRetryCancel | 5 | Display Retry and Cancel buttons. |
Constant | Value | Description |
---|---|---|
vbCritical | 16 | Display Critical Message icon. |
vbQuestion | 32 | Display Warning Query (question mark) icon. |
vbExclamation | 48 | Display Warning Message icon. |
vbInformation | 64 | Display Information Message icon. |
Constant | Value | Description |
---|---|---|
vbDefaultButton1 | 0 | First button is default. |
vbDefaultButton2 | 256 | Second button is default. |
vbDefaultButton3 | 512 | Third button is default. |
vbDefaultButton4 | 1024 | Third button is default. |
Constant | Value | Description |
---|---|---|
vbApplicationModal | 0 | Application modal; the user must respond to the message box before continuing. |
vbSystemModal | 4096 | System modal; all applications are suspended until the user responds to the message box. |
Constant | Value | Description |
---|---|---|
vbMsgBoxHelpButton | 16384 | Adds Help button to the message box. |
vbMsgBoxSetForeground | 65536 | Specifies the message box window as the foreground window. |
vbMsgBoxRight | 524288 | Text is right aligned. |
vbMsgBoxRtlReading | 1048576 | Specifies text should appear as right-to-left reading on Hebrew or Arabic systems. |
Msgbox Creator
This msgbox creator only works in browsers that supports VBScript (This would be any flavor of IE)
Message Box Creator |
||
Message: |
||
Title: |
||
Please select an icon |
||
Please select a button |
||
|
||
|
http://www.javascriptsource.com/text-effects/vb-message-box-creator.html