Problem with form refreshing

  • Thread starter Thread starter dmartin_1
  • Start date Start date
D

dmartin_1

I'm building an application with Visual Basic 2005. The application is
multi threaded. It has a record counter on the form that counts up to
completion. It works fine throughout the process as long as it remains
in top focus. If you bring another program to focus and then go back.
The form is not refreshed until the process is complete. I am calling
me.refresh() within the main process loop. Any ideas why this may
occurr?

Thanks,
Dave
 
DMartin,

You mean that you have made a multithreading process that stops the
mainprocess to do in the background another process, that stops than and
your mainprocess is going on?

Is this meant to let the user click the abort cross in the top?

Have than a look about everything that is written about the backgroundworker
in Net 2.0

http://msdn2.microsoft.com/en-us/library/system.componentmodel.backgroundworker.aspx

You know of course that with this you lengthen the througput time of your
proccess.

I hope this helps,

Cor
 
Not exactly, the application works like this. The main process loops
over data that needs to be processed via an XML service. Three worker
threads are initialized before the loop begins. Once it starts looping
through the data, it looks to see which thread is idle and sends the
current record to the idle thread. Inside the thread, the XML request
is sent, the return data processed, and the results stored into an
access database. In the main process loop, there is record counter
thats displayed on the form the show the current progress. Every time
the record counter is incremented and stored into the textbox, the
form.refresh() command is called. As long as the form stays focused
throughout the process, the refresh works fine. If you send it to the
background and then bring it into focus again. You get not refreshing
until the process completes.
 
Back
Top