PDA

Click to See Complete Forum and Search --> : countdown


skstevesz
Jan 16th, 2000, 10:47 AM
how do i make a countdown from 10 with a one second interval with the decent of each number(the output will be in a label)

------------------
Steve Z

Gumppy
Jan 16th, 2000, 10:56 AM
make a label on a form And create a timer on the form. Within the label set the caption to 10. Then go to the timer sub and make it look like this

Private Sub Timer1_Timer()
Dim Amount As Integer
Amount = Val(Label1.Caption)
If Amount = 0 Then
Timer1.Enabled = False
Else
Amount = Amount - 1
Label1.caption = Str$(Amount)
End if
End Sub

For the timer properties set it to be enabled and the intervall to 1000 I believe thats 1 second i could be wrong though. But Anyways then it will do ur countdown =))