I am currently making a timer for a school project. Im a little new to VB.net and having a few problems getting the timer to work.
When the countdown timer gets to 0 the "-" sign appears in the wrong place. As in i get 0:-1
I would also like the text in the timer to turn red when it enters negative numbers. (Maybe Flash, but i guess that is very complicated).
Anyway here is my current code:
Public Class Form1
Dim TargetTime As System.DateTime
Dim willy As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
willy = TextBox1.Text
If Timer1.Enabled Then
TargetTime = Now.AddMinutes(willy)
Catch ex As Exception
MsgBox("No Time Set")
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim Diff As TimeSpan = TargetTime.Subtract(Now)
Label1.Text = Diff.Minutes & ":" & Diff.Seconds