VB有没有Sleep这样的延时 函数? 在线等待!谢谢
VB有没有Sleep这样的延时 函数? 在线等待!谢谢 问题点数:20、回复次数:2Top
1 楼w18ily(再回首,西门吹沙(学习网络编程))回复于 2002-10-16 16:26:15 得分 20
VB中如何使用延时函数?
*API函数声明:
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
调用:
'延时1秒
Call Sleep(1000)Top
2 楼wxy_xiaoyu(猪是的看来过倒)回复于 2002-10-16 16:54:56 得分 0
Public Delcare Function Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)As Boolean
sleep 1000
以下是自己写的一个:
Public Sub Delay(mSec As Long)
On Error GoTo ShowErr
Dim TStart As Single
TStart = Timer
While (Timer - TStart) < (mSec / 1000)
DoEvents
Wend
Exit Sub
ShowErr:
MsgBox Err.Source & "------" & Err.Description
Exit Sub
End Sub
两个函数有区别,自己看吧Top




