Results 1 to 3 of 3

Thread: [RESOLVED] Windows and Tming Routine Not Working Together

  1. #1

    Thread Starter
    Hyperactive Member neef's Avatar
    Join Date
    Dec 2001
    Location
    Boston
    Posts
    311

    [RESOLVED] Windows and Tming Routine Not Working Together

    I have a timer routine (basically just a timing loop) that moves shapes around the screen. The problem is that it isn't in sync with Windows (Vista). If a Windows background program runs (like an antivirus) the screen goes gray. The timing routine still runs but the display is shut off. Only when the shapes are done moving does the screen return to normal (but I didn't actually see the shapes move). Another good example of my issue is when I finish debugging and press the Start button, again I don't see the shapes move, I just see a grayed out screen with the cursor in "busy" mode.

    All the other VB.NET programming I've done doesn't assume so much control as this timing loop. I've never had to worry about coordinating a routine with other windows functions. What's the trick to getting this stuff to work together smoothly?
    Last edited by neef; May 2nd, 2009 at 03:40 PM.
    Intermediate Level Programmer Extraordinaire

  2. #2
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    Re: Windows and Tming Routine Not Working Together

    I think you're basically saying the loop and everything works, you just don't see it do anything. If that's that case you can put:

    Code:
    Application.DoEvents()
    In your loop so that you can see it moving the shapes around.

  3. #3

    Thread Starter
    Hyperactive Member neef's Avatar
    Join Date
    Dec 2001
    Location
    Boston
    Posts
    311

    Re: Windows and Tming Routine Not Working Together

    That's all I needed thanks. It's nice to learn a simple solution for problems once and a while.
    Intermediate Level Programmer Extraordinaire

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