hopefully code for all those timer needs

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

Show your effort.

What you have done so far? Let us see your codes. Where you have got difficulties?

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

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
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.