Public Class Form1
Dim t%
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
t = Val(InputBox("输入分钟")) * 60
ProgressBar1.Minimum = 0
ProgressBar1.Maximum = t
ProgressBar1.Value = t
Timer1.Interval = 1000
Timer1.Enabled = False
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label1.Text = t \ 60 & ":" & t Mod 60
ProgressBar1.Value = t
t = t - 1
If t < 0 Then
Timer1.Enabled = False
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Enabled = True
End Sub
End Class