Private Sub Timer1_Timer()
 Static num As Integer
 If num = 0 Then
  '红
 End If
 If num = 85 Then
  '绿
 End If
 If num = 85 + 25 Then
  '黄
 End If
 num = num + 1
 num = num Mod (85 + 25 + 5)
End Sub

解决方案 »

  1.   

    开始先设
    timer.Interval = 85
    timer.Enabled = TRUETimer事件里写
    sub Timer_Timer()
       if timer.Interval = 85 then
          redoff()
          greenon()
          timer.Interval = 25 
       elseif timer.Interval = 25 then
          greenoff()
          yellowon()
          timer.Interval = 5 
       elseif timer.Interval = 5 then
          yellowoff()
          redon()
          timer.Interval = 85    
       end if
    end sub
    只是举例,自己发挥了
      

  2.   

    timer.Interval = 85 不对
    单位是 0.001秒 !!!!但您也不能
    timer.Interval = 85 *1000
    因为 timer.Interval 是整型的,85000超出范围.
    必须进行计数。
      

  3.   

    等等好象timer.interval=55最高精度,一秒钟最多次!
      

  4.   

    返回或设置对 Timer 控件的计时事件各调用间的毫秒数。语法object.Interval [= milliseconds]Interval 属性语法有以下组成部分:部分 描述
    object 对象表达式,其值是“应用于”列表中的一个对象。
    milliseconds  数值表达式,指定毫秒数,“设置值”中有详细说明,。
    设置值milliseconds 的设置值为:设置值 描述
    0 (缺省值)使 Timer 控件无效。
    1 to 65,535  设置的时间间隔(以毫秒计),在 Timer 控件 Enabled 属性设置为 True 时开始有效,例如,10,000 毫秒等于 10 秒。最大值为 65,535 毫秒,等于 1 分钟多一些。
    说明可以在设计时或在运行时设置 Timer 控件的 Interval 属性。使用 Interval 属性时,请记住:?Timer 控件的 Enabled 属性决定该控件是否对时间的推移做响应。将Enabled 设置为 False 会关闭 Timer 控件,设置为 True 则打开它。当 Timer 控件置为有效时,倒计时总是从其 Interval 属性的设置值开始。
    ?创建 Timer 事件程序用以告诉 Visual Basic 在每次 Interval 到时该做什么。
      

  5.   

    早上上班比较急,所以发的信息有点不完整,现补上timer.interval=55最高精度,一秒钟最多18次!所以哪怕你将值设定为1毫秒,实际上它并不是1毫秒调用一次,而是55毫秒调用一次的。
    以下代码供参考:
    Public mytime As Long
    Private Sub Form_Load()
    mytime = 0
    End SubPrivate Sub Timer1_Timer()
    With Shape1
    If mytime <= 85 Then .BorderColor = vbRed: .FillColor = vbRed: Label1.Caption = 85 - mytime
    If mytime > 85 And mytime <= 110 Then .BorderColor = vbGreen: .FillColor = vbGreen: Label1.Caption = 110 - mytime
    If mytime > 110 And mytime <= 115 Then .BorderColor = vbYellow: .FillColor = vbYellow: Label1.Caption = 115 - mytime
    mytime = mytime + 1
    If mytime >= 116 Then mytime = 0
    Print Time
    End With
    End Sub