有没有办法让 MessageBox 在设定的时间间隔后自动关闭? [英] Is there a way to get a MessageBox to automatically dismiss after a set interval of time?

查看:24
本文介绍了有没有办法让 MessageBox 在设定的时间间隔后自动关闭?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a VBScript to alert on an event with a MessageBox, but I would like this to be automatically dismissed after 5 seconds or so. Is there a way to achieve this?

推荐答案

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

Use the WshShell Object's Popup method. It has a timeout parameter.

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 上的 MessageBox.

For more, check out my article Mastering the MessageBox on ASP Free.

这篇关于有没有办法让 MessageBox 在设定的时间间隔后自动关闭?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆