3个回答
展开全部
第一种方式:
用API就可以实现。
Private Declare Function MessageBoxTimeout Lib "user32" Alias "MessageBoxTimeoutA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long, ByVal wlange As Long, ByVal dwTimeout As Long) As Long
Private Sub Command1_Click()
MessageBoxTimeout Me.hwnd, "三秒后将关闭.......", "msgbox", vbInformation, 0, 3000
End Sub
第二种方式:
Private Sub Command1_Click()
CreateObject("Wscript.Shell").Popup "三秒后将关闭.....", 3, "MsgBox", vbInformation
End Sub
用API就可以实现。
Private Declare Function MessageBoxTimeout Lib "user32" Alias "MessageBoxTimeoutA" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long, ByVal wlange As Long, ByVal dwTimeout As Long) As Long
Private Sub Command1_Click()
MessageBoxTimeout Me.hwnd, "三秒后将关闭.......", "msgbox", vbInformation, 0, 3000
End Sub
第二种方式:
Private Sub Command1_Click()
CreateObject("Wscript.Shell").Popup "三秒后将关闭.....", 3, "MsgBox", vbInformation
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
Sub MsgBoxTimer() CreateObject("WScript.Shell").Run "mshta.exe vbscript:close(CreateObject(""WScript.Shell"").Popup(""Test"",2,""Real%20Time%20Status%20Message""))"End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询