Recent Post

QTP @ MsgBox


MsgBox – Message Box

  • 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.


MSGBOX – Buttons

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.

MSGBOX – Return values

Constant
Value
Button
vbOK
1
OK
vbCancel
2
Cancel
vbAbort
3
Abort
vbRetry
4
Retry
vbIgnore
5
Ignore
vbYes
6
Yes
vbNo
7
No




Msgbox – demo

ž  Example:
      sMsg = "This is line 1" & vbNewLine & "This is line 2"
      MsgBox sMsg
      MsgBox "Hahaha...I am just laughing..Just like that :):)"
     
      MsgBox "Hahaha...I am just laughing.." & vbNewLine & "Just like that :):)“
      MsgBox ("All Done")
MyVar = MsgBox ("Hello Friend",0, "QuickTest QTP @ GAReddy")
MsgBox MyVar
MyVar = MsgBox ("Are you really interested?",3, "QuickTest QTP @ GAReddy")
MsgBox MyVar

'vbYesNoCancel

MyVar = MsgBox ("Are you really interested?",vbYesNoCancel, "QuickTest QTP @ GAReddy")
MsgBox MyVar
  • 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
o   'vbYesNoCancel
o   MyVar = MsgBox ("Are you really interested?",vbYesNoCancel, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar
o   MyVar = MsgBox ("Are you really interested?",256, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar
o   MyVar = MsgBox ("Are you really interested?",512, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar
o   MyVar = MsgBox ("Are you really interested?",768, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar
o   MyVar = MsgBox ("Are you really interested?",0, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar
o   MyVar = MsgBox ("Are you really interested?",4096, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar
o   MyVar = MsgBox ("Are you really interested?",64, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar
o   MyVar = MsgBox ("Are you really interested?",48, "QuickTest QTP @ GAReddy")
o   MsgBox MyVar

0 comments:

Post a Comment

GAReddy @ OneTestingCenter @ All Articles