- MsgBox
- MsgBox(prompt, buttons, title, helpfile, context)
- Prompt : The text of the message to display in the message box dialog.
- Buttons :The sum of the Button, Icon, Default Button, and Modality constant values.
- Title : The title displayed in the Title-bar of the message box dialog.
- Helpfile :An expression specifying the name of the help file to provide help functionality for the dialog.
- Context : An expression specifying a context ID within helpfile.
Constant
|
Value
|
Description
|
vbOKOnly
|
0
|
Display OK button only.
|
vbOKCancel
|
1
|
Display OK and Cancel buttons.
|
vbAbortRetryIgnore
|
2
|
Display Abort, Retry, and Ignorebuttons.
|
vbYesNoCancel
|
3
|
Display Yes, No, and Cancel buttons.
|
vbYesNo
|
4
|
Display Yes and No buttons.
|
vbRetryCancel
|
5
|
Display Retry and Cancel buttons.
|
vbCritical
|
16
|
Display Critical Message icon.
|
vbQuestion
|
32
|
Display Warning Query icon.
|
vbExclamation
|
48
|
Display Warning Message icon.
|
vbInformation
|
64
|
Display Information Message icon.
|
vbDefaultButton1
|
0
|
First button is default.
|
vbDefaultButton2
|
256
|
Second button is default.
|
vbDefaultButton3
|
512
|
Third button is default.
|
vbDefaultButton4
|
768
|
Fourth button is default.
|
vbApplicationModal
|
0
|
Application modal; the user must respond to the message box before continuing work in the current application.
|
vbSystemModal
|
4096
|
System modal; all applications are suspended until the user responds to the message box.
|
Constant
|
Value
|
Button
|
vbOK
|
1
|
OK
|
vbCancel
|
2
|
Cancel
|
vbAbort
|
3
|
Abort
|
vbRetry
|
4
|
Retry
|
vbIgnore
|
5
|
Ignore
|
vbYes
|
6
|
Yes
|
vbNo
|
7
|
No
|
- var=MsgBox("Hiiiiiiiiiii",4,"GAReddy")
- msgbox var
- MyVar = MsgBox ("Hello Friend",0, "QuickTest QTP @ GAReddy")
- MsgBox MyVar
- MyVar = MsgBox ("Are you really interested?",3, "QuickTest QTP @ GAReddy")
- MsgBox MyVar