比如说到某个特定的时间,就要执行一段程序。
请指教

解决方案 »

  1.   

    用Timer控件,将Interval设置短一点。在Timer控件的Timer1_Interval事件里面判断当前时间是否>=指定时间,如果是,就执行程序,并将Timer控件置为无效。
      

  2.   

    Private Sub Timer1_Timer()
        Dim strCurTime As String
        strCurTime = Format(CStr(Time), "hh:mm:ss")
        
        If strCurTime = "08:00:00" Or strCurTime = "12:30:00" Or strCurTime = "18:30:00" Then
           'DO Something!
        End If
    End Sub
      

  3.   

    1 用Timer控件
    2 还可以用api调用系统时间,或者直接用vb的函数
      例:
      dim a as long
      dim b as long
      a=timer  'timer 是取从午夜开始到现在的秒数
      b = Timer
      Do
          DoEvents
          b = Timer
          
          If b - a > 10000 Then 
             '你想干什么就在这里做吧(不要做犯法的事哦)
          End If
          
        Loop
    至于这段代码放在哪里,你就自己看着办吧.