0% found this document useful (0 votes)
15 views2 pages

Code Stopwatch

This document contains the code for a program with multiple buttons and timers. The buttons are used to start and stop a timer, record start and end times, and calculate elapsed time. The timers update labels to display the current time and elapsed time. Variables are used to store the start, end, and elapsed times which are then formatted and displayed on labels when the buttons are clicked.

Uploaded by

bhslegion1498
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views2 pages

Code Stopwatch

This document contains the code for a program with multiple buttons and timers. The buttons are used to start and stop a timer, record start and end times, and calculate elapsed time. The timers update labels to display the current time and elapsed time. Variables are used to store the start, end, and elapsed times which are then formatted and displayed on labels when the buttons are clicked.

Uploaded by

bhslegion1498
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Dim st As Variant, ent As Variant, elt As Variant, a As Variant, b As Variant, c As

Variant, d As Variant
-----------------------------------------------------------------------------------
-------------------------------
Private Sub Command1_Click()
a = Time
b = Time
Timer2.Enabled = True
End Sub
-----------------------------------------------------------------------------------
-------------------------------
Private Sub Command2_Click()
Timer2.Enabled = False
d = c
End Sub
-----------------------------------------------------------------------------------
-------------------------------
Private Sub Command3_Click()
st = Time
Label8.Caption = Format(st, "hh:mm:ss")
End Sub
-----------------------------------------------------------------------------------
-------------------------------
Private Sub Command4_Click()
ent = Time
Label9.Caption = Format(ent, "hh:mm:ss")
End Sub
-----------------------------------------------------------------------------------
-------------------------------
Private Sub Command5_Click()
elt = ent - st
Label10.Caption = Format(elt, "hh:mm:ss")
End Sub
-----------------------------------------------------------------------------------
-------------------------------
Private Sub Command6_Click()
End
End Sub
-----------------------------------------------------------------------------------
-------------------------------
Private Sub Command7_Click()
Label2.Caption = "00:00:00"
Label8.Caption = ""
Label9.Caption = ""
Label10.Caption = ""
Timer2.Enabled = False
a = Time
b = Time
d = b - a
End Sub
-----------------------------------------------------------------------------------
-------------------------------
Private Sub Form_Load()
Timer1.Interval = 1000
Timer2.Interval = 1000
Timer2.Enabled = False
a = Time
b = Time
d = b - a
Label2.Caption = "00:00:00"
End Sub
-----------------------------------------------------------------------------------
-------------------------------
Private Sub Timer1_Timer()
Label7.Caption = Format(Time, "hh:mm:ss")
End Sub
-----------------------------------------------------------------------------------
-------------------------------
Private Sub Timer2_Timer()
c = b - a
c = c + d
Label2.Caption = Format(c, "hh:mm:ss")
b = Time
End Sub
-----------------------------------------------------------------------------------
-------------------------------

You might also like