VB中的延时函数:自定义do...loop循环
- 时间:2015年04月02日 15:34:00 来源:魔法猪系统重装大师官网 人气:14073
1、新建一个标准模块
2、写入代码
Dim nowtime As Integer
Public Sub Delay(t As Integer)
nowtime = Timer
Do While Timer - nowtime < t
DoEvents
Loop
End Sub
这样一个延时函数就完成了!
工程中需要延时时只需调用该函数
例子:需要延时3秒
call delay(3)
即可!
中的,延时,函数,自定义,do...loop,循环,、,新建
2、写入代码
Dim nowtime As Integer
Public Sub Delay(t As Integer)
nowtime = Timer
Do While Timer - nowtime < t
DoEvents
Loop
End Sub
这样一个延时函数就完成了!
工程中需要延时时只需调用该函数
例子:需要延时3秒
call delay(3)
即可!