2012-07-30 57 views
1

有没有办法让msgbox显示并在一秒钟内消失,我一直在使用下面的脚本,但只能在一秒之内关闭它。在不到一秒钟的时间内显示信息框

Explicit选项 昏暗Wshell,BtnCode 集Wshell =的CreateObject( “wscript.shell”)

BtnCode = Wshell.Popup( “测试”,1, “测试”)

回答

1

我恐怕这是不可能的弹出。 尽管您可以使用Internet Explorer作为用户界面。

Set oIE = CreateObject("InternetExplorer.Application") 

With oIE 
    .navigate("about:blank") 
    .Document.Title = "Countdown" & string(100, chrb(160)) 
    .resizable=0 
    .height=200 
    .width=100 
    .menubar=0 
    .toolbar=0 
    .statusBar=0 
    .visible=1 
End With 

' wait for page to load 
Do while oIE.Busy 
    wscript.sleep 50 
Loop 

' prepare document body 
oIE.document.body.innerHTML = "<div id=""countdown"" style=""font: 36pt sans-serif;text-align:center;""></div>" 
oIE.document.all.countdown.innerText= "test message" 
'the parameters is in miliseconds, so here the message is shown for half a second 
wscript.sleep 500 
oIE.quit 
+0

非常好,谢谢。 – Matt 2012-07-30 12:24:23

相关问题