timer的最小精度是55毫秒,但是如果设置为1毫秒,或者 56毫秒。都是110毫秒的精度.但是精确到 150,250毫秒是没有问题的.无法精确到1个毫秒的.或者百分之一秒.现在有高精度的timer控件,但是是第三方控件,需要付费使用的.Dim t As IntegerPrivate Sub Command1_Click()Timer1.Interval = 1000Timer1.Enabled = Truet = Val(Text1.Text)Label1.Caption = Str(t)End SubPrivate Sub Command2_Click()Timer1.Enabled = FalseLabel1.Caption = ""End SubPrivate Sub Timer1_Timer()t = t - 1If t = 0 Then
MsgBox "时间到!!"
Timer1.Enabled = Falseend ifLabel1.Caption = Str(t)End Sub