Static Sub delayloop(delaytime) '定义时间延迟过程
Dim a As Single
Const b = 24& * 60& * 60&
a = Timer + delaytime
If a > b Then
a = a - b
Do While Timer > a
Loop
End If
Do While Timer < a
Loop
End Sub
Private Sub Command1_Click()
delayloop 20 '调用过程,参数以秒为单位,如果是分钟或小时,先换算成秒.
Unload Me '20秒后关闭窗口
End Sub