1、在“管理项目-全局代码”增加以下代码:
'Message定时自动关闭
Public Declare Function MessageBoxTimeout Lib "user32" Alias "MessageBoxTimeoutA" (ByVal hwnd As Integer, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Integer, ByVal wlange As Integer, ByVal dwTimeout As Integer) As Integer
2、原来的代码改为:
MessageBoxTimeout(BaseMainForm.Handle, "内容123", "提示:", vbOK, 0, 3000) '3秒后自动关闭窗口