2012-07-30 35 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

相關問題