Results 1 to 2 of 2

Thread: Stopwatch Usercontrol

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Posts
    97

    Question Stopwatch Usercontrol

    I've created a nice stopwatch user control that uses the GetTickCount Function to accurately update some labels with hours, minutes and seconds (it also counts millisecs, but doesn't display them).

    The problem is that when you start counting it sits in a loop and you can't do anything else. What I'd ideally want to do is raise a second, minute and hour tick events and also get the time at anypoint, but... without having to be stuck in a loop, so I can do other things at the same time.

    I've added a DoEvents in the loop, so I can click buttons and things, but I'd really like to be able to call other subroutines as well.

    In short, I'm really trying to create a more veratile version of the Timer control that comes with VB.

    Any ideas how I can do this?

    thanks

    Paul

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Stopwatch Usercontrol

    It sounds like you are attempting to run multiple processes and with VB that isn't going to happen.

    Each process requires its own thread. VB is a single thread development platform. Before another process can start, one has to either stop, or yield.

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