MsgBox Function
In the dialog box displays the message, wait for the user clicks the button, and returns a value that indicates the user clicks the button.
MsgBox (prompt [, buttons] [, title] [, helpfile, context])
Parameter
prompt
As the message displayed in the dialog box in the string expression. The maximum length of prompt is approximately 1024 characters, depending on the width of the characters used. If the prompt contains multiple rows, can separate the lines using a carriage return character (Chr (13)), linefeed (Chr (10)) or carriage return line feed combination (Chr (13) & Chr (10 )) separating each line.
Buttons
Numerical expression, is that the specified number and type of display button, the icon style to use the default button ID and message box style values combined. The values, see "Settings" section. If omitted, the buttons of the default value of 0.
Title
Displayed in the dialog box title bar string expression. If you omit title, the application name will appear in the title bar.
Helpfile
String expression that identifies the dialog box to help provide context-sensitive help file. If you have provided helpfile, you must provide the context. In the 16-bit system platform is not available.
Context
Numeric expression that identifies the Help file of help topics assigned to a context number. If you have provided context, you must provide the helpfile. In the 16-bit system platform is not available.
Set up
buttons parameter can have the following values:
Constant Value Description
vbOKOnly 0 display only the OK button.
vbOKCancel 1 Display OK and Cancel buttons.
vbAbortRetryIgnore 2 shows to give up, retry and ignore buttons.
vbYesNoCancel 3 shows that, if and Cancel button.
vbYesNo 4 Display is and whether the buttons.
vbRetryCancel 5 Show Retry and Cancel buttons.
vbCritical 16 shows the critical message icon.
vbQuestion 32 warning query icon.
vbExclamation 48 displays a warning message icon.
vbInformation 64 display information message icon.
vbDefaultButton1 0 the first button as the default button.
vbDefaultButton2 256 second button to the default button.
vbDefaultButton3 512 third button as default button.
vbDefaultButton4 768 fourth button as default button.
vbApplicationModal 0 Application Mode: The user must respond to the message box before continuing work in the current application.
vbSystemModal 4096 system model: the user response to the message box, all applications are pending.
The first group (0 - 5) is used to describe the dialog box button to display the type and number; the second group (16, 32, 48, 64) describes the icon style; the third group (0, 256 , 512) is used to determine the default button; and the fourth group (0, 4096) determines the message box. In these numbers to create buttons parameter values, each value can only access a number.
Return Value
MsgBox function has the following return values:
Constant value of button
vbOK 1 to determine
vbCancel 2 canceled
vbAbort 3 abandoned
vbRetry 4 Retry
vbIgnore 5 Ignore
vbYes 6 is
vbNo 7 No
Explain
When both helpfile and context, the user can press F1 key to view the context of the corresponding help topic.
If the dialog box shows the Cancel button, press ESC key and click Cancel has the same effect. If the dialog box contains a Help button, the dialog box is promising to provide a context-sensitive help. However, click the other button, it will not return any value.
When MicroSoft Internet Explorer use the MsgBox function, the title of any dialog box always contains the VBScript, so to distinguish between the standard dialog box.
The following example demonstrates the use of MsgBox function:
Dim MyVarMyVar = MsgBox (Hello World!, 65, MsgBox Example)''MyVar contains either 1 or 2, depending on which button is clicked.
Recommended links:
Audio file converter
CONVERTER mp4 to avi
realplayer h.264
Running out of WiFi hotspots three operators layout
photoshop to create my own FERRARI
mp4 CONVERTER free download
Evaluate Games Action
One after another anti-piracy Noise compensation 780 000 Shenzhen Haojia reconciliation
PMP Preparation EXPERIENCE
Best Benchmarking
Jinshan is full of personality to create the theme template demo
VS anti-influenza virus, is the key to cut off Transmission
E-cology In The Pan Micro Series 31
IDC Perspective