该段程序是用vb.net实现的。
Public Class Form1
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim 自定义时间 As New 自定义时间
自定义时间.Show()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If Label1.Text = 0 Then
MsgBox("请设置时间!")
Timer1.Enabled = False
Timer2.Enabled = False
Dim 自定义时间 As New 自定义时间
自定义时间.Show()
End If
If Label1.Text > 0 Then
Timer1.Enabled = True
Timer2.Enabled = True
Label3.Text = 60
Label3.Text = Label3.Text - 1
End If
Label1.Text = Label1.Text - 1
when Label1.Text = 0 And Label3.Text = 0