请VB高手进入,本人有一难题
编写一个秒表工作程序,程序运行后,单击开始按纽,该按纽变灰(不可用),在上面的标签中显示开始时间.等一会儿,单击结束按纽;该按纽变灰,同时开始按纽可用,并在中间标签中显示停止时间,在下面的标签中显示经过的时间.
参考答案:凑个热闹,刷2分;
Dim starttime As Long
Private Sub Command1_Click()
starttime = Timer
Label1.Caption = Hour(Now) & ":" & Minute(Now) & ":" & Second(Now)
Timer1.Enabled = True
Command1.Enabled = False
Command2.Enabled = True
Label3.Caption = Int(Timer - starttime) & "秒"
End Sub
Private Sub Command2_Click()
starttime = Timer
Timer1.Enabled = False
Label2.Caption = Hour(Now) & ":" & Minute(Now) & ":" & Second(Now)
Timer1.Enabled = False
Command1.Enabled = True
Command2.Enabled = False
End Sub
Private Sub Timer1_Timer()
Label3.Caption = Int(Timer - starttime) & "秒"
End Sub