English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I understand that you have start() and stop() methods; but how do you start it with a button as a switch and display the time on a label?
Example Timer.Start("WHAT GOES HERE?")
I need to click a button to start is and click a button to stop it.

2007-02-22 16:24:58 · 1 answers · asked by Answerz 4 in Computers & Internet Programming & Design

1 answers

Dim StartTime as Single
Dim StopTime as Single
Private Sub StartButton_Click()
StartTime = Timer
End Sub
Private Sub StopButton_Click()
StopTime = Timer
If StopTime < StartTime then
TimerLabel.Caption = StopTime + 24*3600 - StartTime
Else
TimerLabel.Caption = StopTime - StartTime
End If
End Sub

2007-02-22 17:43:51 · answer #1 · answered by John W 3 · 1 0

fedest.com, questions and answers