CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2000
    Posts
    14

    Timer control interrupt

    Hello,

    Can you help me how to pause a timer to allow user more time to a specific task then to resume the timer? Any help is appreciated. And Thanks!

    NiteStone


  2. #2
    Join Date
    Dec 1999
    Location
    Israel
    Posts
    101

    Re: Timer control interrupt

    You can change in run-time the property Enabled of the Timer control.
    Timer1.Enabled = True means, that timer is opened and "works"
    Timer1.Enabled = False means, that timer is "paused".

    Good Luck!


  3. #3
    Join Date
    Jan 2000
    Posts
    14

    Re: Timer control interrupt

    Hi there,

    Thank you for the reply. I have used this method too. But I am not happy with the performing. Suppose that timer.interval = 30s and I click on Resume button after i clicked on Pause button, it takes almost the interval time to resume. It is too slow. Is there other method to use to avoid the delay problem? Any suggestion is appreciated and Thanks.

    NiteStone




  4. #4
    Join Date
    Dec 1999
    Location
    Israel
    Posts
    101

    Re: Timer control interrupt

    Instead of Timer Control use API Function GetTickCount(), which will allow you to work according
    to cycles of your Processor.

    Good Luck!


  5. #5
    Join Date
    Jan 2000
    Posts
    14

    Re: Timer control interrupt

    Thanks, Ruth, for the help and your time. Cause I already used timer control and really lazy to make change, I found a little trick to get arround the problem: put the excute statements of next task into the resume command. It works. I wonder if there is a way to look into timer control to see how it implements.

    Have a nice day,

    NiteStone


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

Featured