Results 1 to 7 of 7

Thread: [RESOLVED] TIMER -> different code in each interval

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Location
    Netherlands
    Posts
    71

    Resolved [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.

  2. #2
    Hyperactive Member Capp's Avatar
    Join Date
    May 2005
    Location
    Texas
    Posts
    409

    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:
    1. Dim i As Integer
    2.  
    3. Private Sub Form_Load()
    4. i = 11
    5. End Sub
    6.  
    7. Private Sub Timer1_Timer()
    8.         i = i - 1
    9.         Label1.Caption = i
    10.  
    11. End Sub
    AmazingAntivirus.com
    Remote Data Backups


    Please Mark your Thread "Resolved", if the query is solved...

    If a post has helped you then Please Rate it!

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Location
    Netherlands
    Posts
    71

    Re: TIMER -> different code in each interval

    oh, oke I get it... tnx

  4. #4
    Hyperactive Member Capp's Avatar
    Join Date
    May 2005
    Location
    Texas
    Posts
    409

    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:
    1. Dim i As Integer
    2.  
    3. Private Sub Form_Load()
    4. i = 11
    5. End Sub
    6.  
    7. Private Sub Timer1_Timer()
    8.   i = i - 1
    9.   Label1.Caption = i
    10.   if i = 10 then
    11.       'insert code for 10
    12.   elseif i = 9 then
    13.       'insert code for 9
    14.   elseif i = 8 then
    15.       'insert code for 8
    16.   End If
    17. End Sub
    AmazingAntivirus.com
    Remote Data Backups


    Please Mark your Thread "Resolved", if the query is solved...

    If a post has helped you then Please Rate it!

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Location
    Netherlands
    Posts
    71

    Re: TIMER -> different code in each interval

    tnx man

  6. #6
    Hyperactive Member Capp's Avatar
    Join Date
    May 2005
    Location
    Texas
    Posts
    409

    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
    AmazingAntivirus.com
    Remote Data Backups


    Please Mark your Thread "Resolved", if the query is solved...

    If a post has helped you then Please Rate it!

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Location
    Netherlands
    Posts
    71

    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
  •  



Click Here to Expand Forum to Full Width