Timer的时钟间隔最大只有一分钟左右,能不能扩大大的1个小时之内或者有其它的控件吗

解决方案 »

  1.   

    建议你用sleep函数
    Timer不准确
      

  2.   

    Timer的Interval属性的最大值为65535,原因是Interal属性值使用两个字节存储的,两个字节能表示的无符号数的最大取值范围是0-65535。扩大计时范围方法很简单,只要定义个变量来计数就可以了。
      

  3.   

    Option Explicit
    Dim tcount As IntegerPrivate Sub Form_Load()
        Timer1.Interval = 60000
        tcount = 0
    End SubPrivate Sub Timer1_Timer()
        If tcount < 60 Then
            tcount = tcount + 1
            Exit Sub
        Else
            tcount = 0
            '一小时时间到
            '…………
        End If
    End Sub
      

  4.   

    '可控制任何时间间隔:
    option explicit
    const T = 3600       '改变此值即可达到控制更长时间。
    dim T1 as long
    dim T2 as longForm_Load时
       T1 = hour(now) * 3600 + minute(now) + second(now)Timer1_Timer()时:
       T2 = hour(now) * 3600 + minute(now) + second(now)
       if abs(T2-T1)>=T then
          T1 = T2
          msgbox  "时间到!"
       end if
      

  5.   

    '修改如下:'可控制任何时间间隔:
    option explicit
    const T = 3600       '改变此值即可达到控制更长时间。
    dim T1 as long
    dim T2 as longForm_Load时
       T1 = hour(now) * 3600 + minute(now) * 60 + second(now)Timer1_Timer()时:
       T2 = hour(now) * 3600 + minute(now) * 60 + second(now)
       if abs(T2-T1)>=T then
          T1 = T2
          msgbox  "时间到!"
       end if
      

  6.   

    有一个更好的控件 BNTimer 
    Interval property
        Get or set the timer interval. The value ranges from 1ms to 2147483.647s and if the value is 0,the timer will be stopped. 
      

  7.   

    2147483.647s=========================它就是用SetTimer实现的