Is there a way to get a MessageBox to automatically dismiss after a set interval of time?

前端 未结 1 489
予麋鹿
予麋鹿 2021-01-14 15:18

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?

相关标签:
1条回答
  • 2021-01-14 16:05

    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)
    

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

    0 讨论(0)
提交回复
热议问题