Ich bastle derzeit an einem programm was die Zeit zählen soll. und beim Beenden diese Speichert.
Wenn das Programm dann wieder an ist soll er weiter hoch zählen und nicht wieder von 0 Anfangen...
Weiß jemand evtl wo mein Fehler ist?
Code:
Danke im Vorraus
Wenn das Programm dann wieder an ist soll er weiter hoch zählen und nicht wieder von 0 Anfangen...
Weiß jemand evtl wo mein Fehler ist?
Code:
VB.NET-Quellcode
- If plist.Count > 0 Then
- Static lSekTimer As Long
- Dim nDays As Long
- Dim nHours As Long
- Dim nMins As Long
- ' sekundenweise hochzählen
- lSekTimer = lSekTimer + 1
- 'Tage
- nDays = Int(lSekTimer / 86400)
- lSekTimer = lSekTimer - (nDays * 86400)
- ' Stunden:
- nHours = Int(lSekTimer / 3600)
- lSekTimer = lSekTimer - (nHours * 3600)
- ' Minuten
- nMins = Int(lSekTimer / 60)
- lSekTimer = lSekTimer - (nMins * 60)
- Label1.Text = Format$(nDays, "00") & " " & Format$(nHours, "00") & ":" &
- Format$(nMins, "00") & ":" & Format$(lSekTimer, "00")
- Label3.Text = Format$(nDays, "00") & " " & Format$(nHours, "00") & ":" &
- Format$(nMins, "00") & ":" & Format$(lSekTimer, "00")
- lSekTimer = nHours * 3600 + nMins * 60 + lSekTimer
- Else
- My.Settings.PlayTime = Label1.Text
- My.Settings.Save()
- My.Settings.Reload()
- End If
Danke im Vorraus