Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VB.net Sekunden runterzählen

Empfohlene Antworten

Veröffentlicht

hallo :)

ich habe ein kleines Programm geschrieben, dass mir die Anzahl der Tage und Sekunden zwischen dem aktuellen Datum und einem zukünftigen Datum ausgeben soll. soweit klappt auch alles.

Allerdings schaffe ich es nicht, das Programm dazu zu bringen, die Anzahl der Sekunden auch im Sekundentakt runterzuzählen :(

ich habs mit einer While-Schleife versucht, aber dann hängt das Programm irgendwie und wird nicht ausgeführt (Fehlermeldungen gibt es allerdings keine).

Vielleicht kann mir ja jemand einen Tipp geben, wo mein Fehler liegt :confused:

Hier mal der betreffende Quellcode:

Private Sub MainFormLoad(sender As System.Object, e As System.EventArgs)

Dim actuell As Date 

Dim Urlaub As Date

Dim CountS As Long

Dim CountD As Integer


actuell = System.DateTime.Today    'aktuelles Datum

Urlaub = CDate("06.08.2005")          


CountD = Urlaub.Subtract(actuell).Days    'Tage bis zum zukünftigen Datum

CountS = CountD*24*60*60                   'Sekunden


Me.lblCountDays.Text = CountD


Do While CountS > 0 

Me.lblCountSec.Text = CountS       'Sekunden runterzählen?

CountS -=1


Loop 


Sub End

Vielen Dank schon mal!

~tine~

hmmmm vllt nen timer verwenden...nur so ne idee von vielen....

hmmmm vllt nen timer verwenden...nur so ne idee von vielen....

timer is wohl das beste ;)

und wenn man das mit ner schleife machen will sollten da n paar do events rein... aber ka obs die bei VB.NET gibt, bei VB6 gibts die zumindest ;)

nimm den timer aus deiner werkzeugliste [toolbox].

hast du die msdn? rest steht da, sonst nochmal fragen.

bigredeyes

vielen dank für die antworten! mit dem timer hats ohne probleme funktioniert. :marine

gruß, ~tine~

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.