3 回答

TA貢獻1982條經(jīng)驗 獲得超2個贊
API函數(shù)sleep()
功能暫停執(zhí)行,參數(shù)單位毫秒
如:sleep(1000) 暫停1秒
Public Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

TA貢獻1963條經(jīng)驗 獲得超6個贊
dim needtostop as boolean
Private Sub Form_Load()
needtopause=false
end sub
private sub buttonpauseclick()
needtopause=true
end sub
private sub buttonresumeclick()
needtopause=false
end sub
....
Do While SPath <> ""
CurrentPath = Path & SPath
Form1.StaPath.Panels(1).Text = CurrentPath
DoEvents
while needtopause
doevents
wend
If SPath <> "." And SPath <> ".." Then
' 使用位比較來確定 SPath 代表一目錄。
....
這樣應(yīng)該在制定的loop之內(nèi)暫停
添加回答
舉報