-
Timer object
Hello There,
I would like to ask if anybody here know how to stop timer from another class?
let say:I have a timer object started in Class A and I want to stop that timer in Class B..how can i do that?..pls help me.:(
thank you in advance for all the reply..
glen
-
Re: Timer object
Put a Public Sub in ClassA. If ClassA started off as a Form, it may help to add the Shared keyword:
Code:
Public Shared Sub StopTimer
Me.Timer1.Stop
End Sub
When you need to stop the timer, call the sub from ClassB, using the ClassName:
If the sub above gives an error, probably it's because the Timer itself isn't shared. In that case, leave out the Shared keyword. You have to reference the sub through an instance of ClassA:
Code:
Dim myClassA as New ClassA
myClassA.StopTimer
cheers, BB
-
Re: Timer object
i give it a try later..thanks
i will post back if it solved my problem..:)
-
Re: Timer object
i tried to run my app and the problem still not resolved.
is there any other way to do this?
thanks