把下面的放到模块 '延时 Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) 用sleep 数字 就可以延时了 如:sleep 1000就表示延时一秒
Public Declare Function GetTickCount Lib "kernel32" () As Long Sub TimeDelay(TT As Long) Dim t As Long t = GetTickCount() Do DoEvents If GetTickCount - t < 0 Then t = GetTickCount Loop Until GetTickCount - t >= TT End Sub 延时:timedelay(1000)
'延时
Public Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
用sleep 数字 就可以延时了
如:sleep 1000就表示延时一秒
Sub TimeDelay(TT As Long)
Dim t As Long
t = GetTickCount()
Do
DoEvents
If GetTickCount - t < 0 Then t = GetTickCount
Loop Until GetTickCount - t >= TT
End Sub
延时:timedelay(1000)