Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27356

[RESOLVED] Timed Code

$
0
0
Hi All

Looking for the user to be able to enter a time into a textbox in the format:

17:00:00

And when the programme is running, and the time reaches 17:00:00, it will trigger some code.

Here's some code I tried and didn't work.

Code:

  Dim theTime As DateTime

        theTime = CDate(tbTime.Text)

        If theTime.Hour = Now.Hour And theTime.Minute = Now.Minute Then
            Label1.Text = "it worked"
        End If

It said that conversion from string to date is not valid.

Help is appreciated.

Viewing all articles
Browse latest Browse all 27356

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>