Timer1.Interval = 65535如果我要编写2分钟怎么办?
的有关信息介绍如下:
Private Sub Form_Load()
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
Static Count As Integer
Count = IIf(Count < 120, Count + 1, 120)
If Count = 120 Then MsgBox "时间到": Timer1.Enabled = False
End Sub
一楼和三楼真是误人子弟
timer的Interval 最对能调65535
你们那样说真是不负责任
二楼和四楼正解
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 12000
End Sub
Private Sub Timer1_Timer()
MsgBox "喂,两分钟了,该睡觉了"
End Sub
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = False
Shape1.FillColor = vbGreen
Shape1.FillStyle = 0
End Sub
Private Sub Timer1_Timer()
Static sum As Integer
Label1.Caption = sum
sum = sum + 1
If sum >= 120 Then
Shape1.FillColor = vbRed
Label1.Caption = "时间到!"
Timer1.Enabled = False
End If
End Sub
1秒=1000毫秒
=后面的值是时间
2分钟是120秒
就是120000



