Results 1 to 4 of 4

Thread: Timer to continue ticking [RESOLVED]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Resolved Timer to continue ticking [RESOLVED]

    OK, I know I'm full of problems, but please bear with me. I appreciate the help.

    OK, I have a Timer. I know that in VB6 it was very different, but in VB.NET it appears that once the timer reaches it's interval, it stops ticking. Am I right? Well I'm having trouble with it and that matter. I have a code that goes like this:
    VB Code:
    1. Private Sub tmrTimeLeft_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrTimeLeft.Tick
    2.         Dim TimeLeft As Integer = 180
    3.         TimeLeft = TimeLeft - 1
    4.         lblTimeLeft.Text = TimeLeft
    5.     End Sub
    And in the form Activated event, it is supposed to enable the timer.

    I don't get what is wrong. I see the label change to 179 from 180 and that is it. If you help, I would appreciate it if you don't do the whole thing for me, as this is part of a school assignment and I don't want to have to take code of people. Thanks.
    Last edited by martw; May 14th, 2005 at 06:09 AM. Reason: Resolved
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

  2. #2
    Hyperactive Member
    Join Date
    Mar 2004
    Location
    Prato - Tuscany - Italy
    Posts
    461

    Re: Timer to continue ticking

    Timer ticks until you disable it. I can imagine your Timer ticking, then it declares and initializes a variable called TimeLeft then it changes its value to 179 and then it assigns this value (179) to the text property of a label. If you want to see your label countdown, then you have to declare TimeLeft as Static.
    Live long and prosper (Mr. Spock)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Posts
    124

    Re: Timer to continue ticking

    Thanks alextyx. Thats the same as in VB6 isn't it... LoL
    I never know what to put in this section...



    So sue me... ... ... I'm just kidding...


    www.fat-pie.com Flash Movies... You gotta see 'em to believe 'em!

  4. #4
    Hyperactive Member
    Join Date
    Mar 2004
    Location
    Prato - Tuscany - Italy
    Posts
    461

    Re: Timer to continue ticking [RESOLVED]

    I think so, but I'm not sure of that, because I started to program in visual language directly from VB.Net. Bye and good job, friend!
    Live long and prosper (Mr. Spock)

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