2012-01-17 119 views
0

10秒から1秒のカウントダウンと10秒後にオートクローズを表示するMessageBoxを表示したかったのです。 MSGBOXはVBScriptでその上にユーザーの行為刚性コードの実行を通過すると、私はWscriptのShellオブジェクトのポップアップを使用して、それを試してみましたVBScriptでVBScriptのグラフィック要素を使用してカウントダウンを表示する

 
Dim counter 
Dim oShell 
counter = 10 
Set oShell= CreateObject("Wscript.Shell") 
While counter > 0 

oShell.Popup " Left " & counter & " Seconds",1,"Remind" 
counter = counter-1 
Wend 

しかし、それは毎秒の自動閉じ、新しいポップアップを開くには、私は表示することができますどのような方法がありますカウントダウンと自動クローズ

答えて

1

恐れていない、ポップアップはモーダルです&は表示されているときに対話できないので、既存のコンテンツを更新する方法はありません。

より柔軟なUIが必要な場合は、コンソールやHTMLをHTAで使用する必要があります。

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 500 
Loop 

' prepare document body 
oIE.document.body.innerHTML = "<div id=""countdown"" style=""font: 36pt sans-serif;text-align:center;""></div>" 

' display the countdown 
for i=10 to 0 step -1 
    oIE.document.all.countdown.innerText= i 
    wscript.sleep 1000 
next 
oIE.quit 
関連する問題