Results 1 to 19 of 19

Thread: Do not use Timers incorrectly

Threaded View

  1. #1

    Thread Starter
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    Do not use Timers incorrectly

    Many people are having problems with timers and asking about timers. If you want to use a timer in your app. Please follow these suggestion to help insure that you do not have problems.

    1) In VB6, Do not Disable and Re-Enable your timer. This will cause your timer to still run after the program is terminated causing the timer function to still run (unless you disable the timer in your unload code).

    Upon entering the timer code use

    VB Code:
    1. Private Sub Timer1_Timer()
    2.  
    3. 'Add your code here
    4.  
    5. End Sub
    2) You can use more than one timer on a form.

    Seperate your code into each timer that will interrupt on it own interval. Timers should not be confused with timing functions. A timer will interrupt your code on the set intervals so that you may do other things. Timing functions are called to time the elapsed time between set areas in code or time betwwen events happening.

    Following these rules will make sure that your problems are not timer issues.
    Last edited by randem; May 9th, 2005 at 04:13 PM.

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