Problem with form refreshing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dmartin_1@hotmail.com

    #1

    Problem with form refreshing

    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

  • Cor Ligthert [MVP]

    #2
    Re: Problem with form refreshing

    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 backgroundworke r
    in Net 2.0

    http://msdn2.microsoft.com/en-us/lib...undworker.aspx

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

    I hope this helps,

    Cor


    <dmartin_1@hotm ail.com> schreef in bericht
    news:1150227744 .772380.270440@ h76g2000cwa.goo glegroups.com.. .[color=blue]
    > 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
    >[/color]


    Comment

    • dmartin_1@hotmail.com

      #3
      Re: Problem with form refreshing

      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.

      Comment

      Working...