|
-
Mar 8th, 2007, 12:29 PM
#1
Thread Starter
Lively Member
[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?
Last edited by ///Jeffrey\\\; Mar 8th, 2007 at 12:39 PM.
-
Mar 8th, 2007, 12:33 PM
#2
Hyperactive Member
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
-
Mar 8th, 2007, 12:34 PM
#3
Thread Starter
Lively Member
Re: TIMER -> different code in each interval
oh, oke I get it... tnx
-
Mar 8th, 2007, 12:35 PM
#4
Hyperactive Member
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
-
Mar 8th, 2007, 12:36 PM
#5
Thread Starter
Lively Member
Re: TIMER -> different code in each interval
tnx man
-
Mar 8th, 2007, 12:38 PM
#6
Hyperactive Member
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
-
Mar 8th, 2007, 12:39 PM
#7
Thread Starter
Lively Member
Re: TIMER -> different code in each interval
I was allready doing that
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|