@BattleStar-Galactica wrote:
BTW autopilot why you do a lot of thing for nothing, the formula shown is so simple and can be used in vbnet or c#
example hour.ToString(“00”) ect
Well… the reason is simple… didn’t know i could do it that way 🙂 Thanks for the tip
autopilot
What my timer became:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'increase sec by 1
sec += 1
'process sec
If sec > 59 Then
sec = 0
min += 1
s = "00"
Else
s = sec.ToString("00")
End If
'process min
If min > 59 Then
min = 0
hour += 1
m = "00"
Else
m = min.ToString("00")
End If
'process hour
h = hour.ToString("00")
'update the listview
ListView1.Items.Item(0).Text = String.Format("{0}:{1}:{2}", h, m, s)
End Sub