Timer to continue ticking [RESOLVED]
OK, I know I'm full of problems, but please bear with me. I appreciate the help. :thumb:
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:
Private Sub tmrTimeLeft_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrTimeLeft.Tick
Dim TimeLeft As Integer = 180
TimeLeft = TimeLeft - 1
lblTimeLeft.Text = TimeLeft
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. :wave: Thanks.
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.
Re: Timer to continue ticking
Thanks alextyx. Thats the same as in VB6 isn't it... LoL :D
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! :wave: