Well im trying to make a countdown
but i need a little help in here.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Timer1.Interval = 500
Timer1.Start()
End Sub
Dim stpw As New Stopwatch
Dim CountDownFrom As Integer = 60 * 60
Dim CountDown As New TimeSpan
Private Sub StartCountDown()
CountDown = TimeSpan.FromSeconds(CountDownFrom)
stpw.Stop() : stpw.Reset() : stpw.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Not stpw.IsRunning Then Exit Sub
Dim TimeRemaining As TimeSpan = CountDown - stpw.Elapsed
TextBox1.Text = TimeRemaining.Hours.ToString.PadLeft(2, "0"c) & ":" & _
TimeRemaining.Minutes.ToString.PadLeft(2, "0"c) & ":" & _
TimeRemaining.Seconds.ToString.PadLeft(2, "0"c)
If TimeRemaining.TotalMilliseconds <= 0 Then stpw.Stop()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
StartCountDown()
Timer1.Start()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Timer1.Stop()
End Sub
it only countdown by the
Dim CountDownFrom As Integer = 60 * 60
i would like to put like
Button3 give the integer of 60 min that is 60 * 60
and button4 give the integer 30 * 60
so
TextBox1 is blank i click button 3 should put 00:60:00
and if button4 is clicked too it should add 30 min more wold be
01:30:00
help please this is 2 much for me :(