Option ExplicitPublic lTimerId As Long Private Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long Private Declare Function KillTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As LongPrivate Sub TimerProc(ByVal lHwnd As Long, ByVal lMsg As Long, ByVal lTimerId As Long, ByVal lTime As Long) '写入你的代码 End SubPublic Sub StartTimer(lMinute As Long) lTimerId = SetTimer(0, 0, lMinute, AddressOf TimerProc) End SubPublic Function StopTimer(lTimerId As Long) As Long StopTimer = KillTimer(0, lTimerId) End Function ------------------- 应该比TIMER控件好点。
Private Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Private Declare Function KillTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As LongPrivate Sub TimerProc(ByVal lHwnd As Long, ByVal lMsg As Long, ByVal lTimerId As Long, ByVal lTime As Long)
'写入你的代码
End SubPublic Sub StartTimer(lMinute As Long)
lTimerId = SetTimer(0, 0, lMinute, AddressOf TimerProc)
End SubPublic Function StopTimer(lTimerId As Long) As Long
StopTimer = KillTimer(0, lTimerId)
End Function
-------------------
应该比TIMER控件好点。