Option Explicit
Dim mTime1 As Date
Private Sub Command1_Click()
If Command1.Caption = "开始" Then
Label2.Caption = "开始时间: " & CStr(Format(Now, "hh:mm:ss AM/pm"))
Timer2.Enabled = True
Timer2.Interval = 1000
mTime1 = "00:00:00"
Command1.Caption = "结束"
Label3.Caption = "共用时间: "
Else
Timer2.Enabled = False
Timer2.Interval = 0
Command1.Caption = "开始"
Label3.Caption = "共用时间: " & CStr(mTime1)
End If
End Sub
Private Sub Form_L)
Command1.Caption = "开始"
Timer1.Enabled = True
Timer1.Interval = 1000
Timer2.Enabled = False
End Sub
Private Sub Timer1_Timer()
Label1.Caption = "当前时间: " & CStr(Format(Now, "hh:mm:ss AM/pm"))
End Sub
Private Sub Timer2_Timer()
mTime1 = TimeValue(mTime1) + TimeValue("00:00:01")
End Sub screen.width*0.35) this.width=screen.width*0.40