I have a countdown timer on my form that counts down from 20:00 minutes.. but I would also like to add another timer that counts the time elapsed (the time the form has been open, ill call that playing time)
I want it so it updates the label each second with how long the form has been open.
so 00:01, then 00:02, etc..
Heres the code i used for the countdown timer.. maybe someone knows how i can reverse it to count up instead.
I want it so it updates the label each second with how long the form has been open.
so 00:01, then 00:02, etc..
Heres the code i used for the countdown timer.. maybe someone knows how i can reverse it to count up instead.
Visual Basic:
Private myStartTime As DateTime
'Sets timer to countdown when enabled
Dim myTimeElapsed As TimeSpan = DateTime.Now.Subtract(myStartTime)
Dim myTimeLeft As New TimeSpan(0, 20, 1)
myTimeLeft = myTimeLeft.Subtract(myTimeElapsed)
lblTime.Text = myTimeLeft.Minutes.ToString("00") & ":" & myTimeLeft.Seconds.ToString("00")