Re: The big Debate on DoEvents
- From: gene kelley <okay@xxxxx>
- Date: Wed, 14 Jun 2006 03:02:37 -0700
On 14 Jun 2006 01:21:14 -0700, "Dave" <davesauny@xxxxxxxxx> wrote:
Ok All,
I have a program that receives information from the serial port.
Occasionally this information requires me to raise an event and update
a progressbar telling me how much of the information I have received.
My problem lies there. When i update the progressbar, I need to update
the display.... progressbar.refresh, nice and simple, however, if the
user clicks on the screen at any point whilst receiving information
from the serial port, the whole program appears to lock up.... the
screen goes white until the information has completed receiveing
information on the serial port. I therefore implemented an
Application.doevents() after updating the progressbar. This has slowed
the whole process down completely. The information I receive takes
about 1 minute to receive, however with a DoEvents call it takes twice
as long.... this is not acceptable!
Does anyone have any idea how to speed this up whilst also keeping the
form alive? I can't allow my users to see a (not responding) at the
top of the screen and I can't afford to have the time it takes to
receive anything double!
Please help!
Thanks
Dave
From my own experiences thus far, compared to it's use in VB6,DoEvents() in Net does not seem to work and I pretend it doesn't even
exist.
However, the situation you are describing is a classic example of a
process that should be running in a separate thread and would be a
good place to start if you're not familiar with Threads.
Gene
.
- References:
- The big Debate on DoEvents
- From: Dave
- The big Debate on DoEvents
- Prev by Date: Re: Problem connecting to SQL Server
- Next by Date: Re: Changing datagridview cell borders at runtime
- Previous by thread: The big Debate on DoEvents
- Next by thread: Re: The big Debate on DoEvents
- Index(es):
Relevant Pages
|