[RESOLVED] TIMER -> different code in each interval
what I want, is that a timer can do a different code in each interval,
in this case I want to have a countdown shown at the caption of a lable...
So the code in the timer, much give for expample the first time:
Lable1.caption = 10 And the next interval, Lable1.caption = 9 ect.
So in each interval a different Output, how can I do this?
Re: TIMER -> different code in each interval
This will count backward from 10 to 0 in 1-second increments and display it in a label.
vb Code:
Dim i As Integer
Private Sub Form_Load()
i = 11
End Sub
Private Sub Timer1_Timer()
i = i - 1
Label1.Caption = i
End Sub
Re: TIMER -> different code in each interval
oh, oke I get it... tnx :)
Re: TIMER -> different code in each interval
If you are wanting to execute a specific code at each interval, you can do it like this:
vb Code:
Dim i As Integer
Private Sub Form_Load()
i = 11
End Sub
Private Sub Timer1_Timer()
i = i - 1
Label1.Caption = i
if i = 10 then
'insert code for 10
elseif i = 9 then
'insert code for 9
elseif i = 8 then
'insert code for 8
End If
End Sub
Re: TIMER -> different code in each interval
Re: TIMER -> different code in each interval
No problem,
If you feel your issue has been solved, please use the Thread Tools menu and mark this thread as Resolved :)
Re: TIMER -> different code in each interval
I was allready doing that ;)