VB高手速度来 计时器代码 在线等待 修改问号的地方!
'你想做计时器吗?代码如下
Dim t(3) As Integer
Private Sub Cmd_Click(Index As Integer)
Select Case Index
Case 0
Timer1.Enabled = True
Cmd(1).Enabled = True
If Cmd(0).Caption = "开始" Then
Cmd(0).Caption = "继续"
End If
Cmd(0).Enabled = False
Case 1
Timer1.Enabled = False
Cmd(0).Enabled = True
Cmd(1).Enabled = False
Case 2
End
End Select
End Sub
Private Sub Timer1_Timer()
t(3) = t(3) + 1
If t(3) = 60 Then
t(3) = 0
t(2) = t(2) + 1
If t(2) = 60 Then
t(2) = 0
t(1) = t(1) + 1
End If
End If
For i = 1 To 3
Text(i).Text = t(i)
Next
End Sub
多重随机标签