现在我需要这个控件,可是在控件栏里找不到,谢谢!

解决方案 »

  1.   

    Private Declare Function SetTimer Lib "user32" Alias "SetTimer" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
      

  2.   

    =====================================================================================
    Module1.bas
    =====================================================================================
    Option ExplicitPublic Declare Function KillTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As LongPublic Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As LongPublic Sub MyTimerProc()
        Form1.Text1.Text = Val(Form1.Text1.Text) + 1
    End Sub
    ====================================================================================
    Form1.frm
    ====================================================================================
    Option ExplicitPrivate m_nTimerID As LongPrivate Sub Command1_Click()
        m_nTimerID = SetTimer(0, 0, 1000, AddressOf MyTimerProc)
    End SubPrivate Sub Command2_Click()
        KillTimer 0, m_nTimerID
    End Sub
    =====================================================================================