Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Countdown Timer
paulbacca
post Jan 4 2008, 03:01 PM
Post #1


Newbie
*

Group: Members
Posts: 2
Joined: 4-January 08
Member No.: 55,704



Hi all,
Can you help me with the script below. I found this code on a old posting. I would like to able too input a value for hours and have that countdown also.
Thanks

Paul


CODE
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim hours As Integer = countminutes.Text
Dim minutes As Integer = countminutes.Text
Dim seconds As Integer = countseconds.Text
If hours = 0 And minutes = 0 And seconds = 0 Then
'MsgBox("Time Ended")
Timer1.Stop()
End If
If seconds = 0 Then
minutes -= 1
seconds += 60
End If
seconds -= 1
If minutes <> -1 Then
counthours.Text = minutes
countminutes.Text = minutes
countseconds.Text = seconds
End If
End Sub


Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If InStr(timetowait.Text, ":") Then
Dim time() As String
time = Split(timetowait.Text, ":", , CompareMethod.Text)

countminutes.Text = time(0)
countseconds.Text = time(1)
Timer1.Interval = 1000
Timer1.Start()
Else : MsgBox("You have to insert like this 1:10")
End If
End Sub


This post has been edited by paulbacca: Jan 4 2008, 03:22 PM
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. [vb.net 2k5] Countdown (help)(2)


 



- Lo-Fi Version Time is now: 6th September 2008 - 07:14 PM