谢谢帮忙。

解决方案 »

  1.   

    API :Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)比如Sleep(1000)就是延迟一秒。
      

  2.   


    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 SubEnd Sub
      

  3.   

    'This project needs a button
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Private Sub Command1_Click()
     
        Me.Caption = "Your system will sleep 5 sec."
        'Sleep for 5000 milliseconds
        Sleep 5000
        Me.Caption = ""
    End Sub
    Private Sub Form_Load()
        Me.Caption = ""
        Command1.Caption = "Sleep ..."
    End Sub