Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am using timer control in a form, i call this control from a vb class file which internally called by vb module.
Timer is working until i exit from vb class file. When i check the value of timer.enabled in vb module (after existing from vb class) it is false.

Can anyone help me why the timer stops when it exits class file?

Thanks.
Posted
Comments
Sergey Alexandrovich Kryukov 2-Feb-14 13:18pm    
This is a kind of very usual problems you face with timers, which just needs more accurate programming. Without seeing your code, it's hard to say anything certain (isn't it obvious?). Please see: SSCCE on how to do it.

Besides, you need to explain why would you needed to use a timer in first place, not anything else. In most cases, using timers is not the best option.

—SA
Member 20 2-Feb-14 13:28pm    
It's a migrated code from vb 6 to VS 2008. The code was working in vb 6. After migration, i checked the timer is working but it stops when i exit vb class file.
Sergey Alexandrovich Kryukov 2-Feb-14 14:07pm    
First of all, rethink using timer. VB6 was never an adequate development tool. For example, it lacks threading; and chances are, you would need it, not timers.
—SA
Member 20 2-Feb-14 13:29pm    
Is it possible to share some example program which suits this scenario?
Sergey Alexandrovich Kryukov 2-Feb-14 14:08pm    
This is no good in first place. It's bad to use timers, and bad to use DoEvents. You need to explain your ultimate goals, before moving any further.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900