Displays text in a pop-up message box.
|
---|
intButton = object.Popup(strText,[nSecondsToWait],[strTitle],[nType]) |
Arguments
- object
WshShell object.
- strText
String value containing the text you want to appear in the pop-up message box.
- nSecondsToWait
Optional. Numeric value indicating the maximum length of time (in seconds) you want the pop-up message box displayed.
- strTitle
Optional. String value containing the text you want to appear as the title of the pop-up message box.
- nType
Optional. Numeric value indicating the type of buttons and icons you want in the pop-up message box. These determine how the message box is used.
- IntButton
Integer value indicating the number of the button the user clicked to dismiss the message box. This is the value returned by the Popup method.
Remarks
Example
The following code generates a simple pop-up window.
Visual Basic Script | Copy Code |
---|
Dim WshShell, BtnCode
Set WshShell = WScript.CreateObject("WScript.Shell")
BtnCode = WshShell.Popup("Do you feel alright?", 7, "Answer This Question:", 4 + 32)
Select Case BtnCode
case 6 WScript.Echo "Glad to hear you feel alright."
case 7 WScript.Echo "Hope you're feeling better soon."
case -1 WScript.Echo "Is there anybody out there?"
End Select |
JScript | Copy Code |
---|
var WshShell = WScript.CreateObject("WScript.Shell");
var BtnCode = WshShell.Popup("Do you feel alright?", 7, "Answer This Question:", 4 + 32);
switch(BtnCode) {
case 6:
WScript.Echo("Glad to hear you feel alright.");
break;
case 7:
WScript.Echo("Hope you're feeling better soon.");
break;
case -1:
WScript.Echo("Is there anybody out there?");
break;
} |
See Also