How to use popup method [vbs]

时间:2015-09-19 ┊ 阅读:2,426 次 ┊ 标签: none

'Popup method: 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
Const wshOKDialg = 0
Const wshOKCancelDialog = 1
Const wshAbortRetryIgnoreDialog = 2
Const wshYesNoCancelDialog = 3
Const wshYesNoDialog = 4
Const wshRetryCancelDialog = 5
Const wshStopMark = 16
Const wshQuestionMark = 32
Const wshExclamationMark = 48
Const wshInformationMark = 64
'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
Const wshOK = 1
Const wshCancel = 2
Const wshAbort = 3
Const wshRetry = 4
Const wshIngore = 5
Const wshYes = 6
Const wshNo = 7
Const wshDefault = -1
'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
'The Popup method displays a message box regardless of which host executable file is running
'(WScript.exe or CScript.exe). If nSecondsToWaitis equals zero (the default),
'the pop-up message box remains visible until closed by the user. If nSecondsToWaitis is greater than zero,
'the pop-up message box closes after nSecondsToWait seconds. If you do not supply the argument strTitle,
'the title of the pop-up message box defaults to "Windows Script Host."

Dim WshShell
Set WshShell = CreateObject("WScript.Shell")
intReturn = WshShell.Popup("Do you want to delete this file?", _ 5, "Delete File", wshYesNoDialog + wshExclamationMark)

Select Case intReturn
Case 6 WScript.Echo "Yes btn clicked."
Case 7 WScript.Echo "No btn clicked."
Case -1 WScript.Echo "The popup timed out."
End Select

从百度空间搬回来的,百度空间已经停用了。

文章评论

添加新评论

温馨提醒:如果您是第一次在本站留言,需要审核后才能显示哦!

相关文章