【问题标题】:Is there a way to get a MessageBox to automatically dismiss after a set interval of time?有没有办法让 MessageBox 在设定的时间间隔后自动关闭?
【发布时间】:2012-04-20 19:18:23
【问题描述】:

我有一个 VBScript 来提醒带有 MessageBox 的事件,但我希望它在 5 秒左右后自动关闭。有没有办法做到这一点?

【问题讨论】:

标签: vbscript


【解决方案1】:

使用 WshShell 对象的 Popup 方法。它有一个超时参数。

intTimeout = 10      'Number of seconds to wait
strMessage = "This is my message box!"
strTitle = "Hello, world!"

Set WshShell = CreateObject("WScript.Shell")
intResult = WshShell.Popup(strMessage, intTimeout, strTitle)

有关更多信息,请查看我关于 ASP Free 的文章 Mastering the MessageBox (archive)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-05-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多