Results 1 to 4 of 4

Thread: TIMER Question

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2002
    Location
    New York
    Posts
    51

    TIMER Question

    hey everyone,

    how can i get a vb timer control interval to go over 65,555 ms (1 minute) .... maybe at least every 10 minutes or more ??

    Thanks,
    Paolo

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: TIMER Question

    Originally posted by Pyabut
    hey everyone,

    how can i get a vb timer control interval to go over 65,555 ms (1 minute) .... maybe at least every 10 minutes or more ??

    Thanks,
    Paolo
    well short answer: you can't

    answer you want: the timer interval is an integer.. which is cause for its limitation.. but you can get around it 1 of 2 ways

    1) there are Timer API functions and you can use them to create your own timer through code. If you are not familiar with the Win32 API then this might be difficult for you.

    2) the easier way is to set the timer interval to 60000 (1 minute) and when the timer event fires, you increase a count variable by 1. When the variable = 10 then you run whatever code you want.. something like this

    VB Code:
    1. Private Sub Timer1_Timer()
    2.     Static intCount as integer
    3.     intCount = intCount + 1  
    4.     if intCount = 10 then
    5.         intCount = 0
    6.         'Put code you want to run here
    7.     end if
    8. End Sub

  3. #3
    Addicted Member nota141's Avatar
    Join Date
    Feb 2000
    Location
    The place down there under everyone else.
    Posts
    224
    get the timer to run and check the store the system time + 10 min and then check that time with the system time when they match or stored is greater that current run the code.
    On Error wake up and try again ;-)
    ___________________________
    ICQ # 65392645
    email - [email protected]

    Visual Studio 6 ent with SP5 Running on XP with an AMD 1.2 ThunderBird with 512 MB RAM And a 120GB primary HDD (very sweet)

  4. #4

    Thread Starter
    Member
    Join Date
    Oct 2002
    Location
    New York
    Posts
    51
    Thanks everybody and i will try that kleinma

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