3
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by P.manidas
0

I aim to make a simple program that monitors how long a user takes to start and stop a timer instead of a countdown timer any ideas

Edited by dreadfulalpha76: n/a

0

this is what i've got so far but unsure how to make the time appear in seconds


Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

lblascii.Caption = KeyCode

If KeyCode = 13 Then
Timer1.Enabled = True
End If

If KeyCode = 8 Then
Timer1.Enabled = False And MsgBox("time elapsed =" & time.Caption)
End If

End Sub

Private Sub Timer1_Timer()

time.Caption = time.Caption + 1

End Sub

0

See the codes. I have done modification something on your Timer1_Timer() event and added form_load() event

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
lblascii.Caption = KeyCode
If KeyCode = 13 Then
Timer1.Enabled = True
End If
If KeyCode = 8 Then
Timer1.Enabled = False And MsgBox("time elapsed =" & time.Caption)
End If
End Sub

Private Sub Timer1_Timer()
time.Caption = Val(time.Caption) + 1
End Sub

Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 1000 '1000 for 1 second
End Sub

Edited by P.manidas: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.