refreshing the screen

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Art

    refreshing the screen

    I've got a program that I run -- it's under the control of a form. Part of
    the process is fairly lengthy (10 minutes). The form has a control that lets
    me know how far it's gotten.

    My problem is that if I switch to, say, e-mail and then try to get back to
    my form it will not appear until it finishes the lengthy step.. When I
    update the control (with the status) I tell the form to refresh. Is there
    something else I need to do so that I can switch away from the application
    and then go back to it again and see the status?

    I'd appreciate any suggestions.

    Art
  • Scott Swigart

    #2
    Re: refreshing the screen

    The "easy" way is to call doevents regularly during your 10 minute process
    (say, once per second, if possible).

    Another way is to do your long running process in a background thread. Look
    into the Thread class. Here's an example from another post:





    "Art" <Art@discussion s.microsoft.com > wrote in message
    news:B5BE764A-B569-4D4F-A7B8-8E1B03BA8EB9@mi crosoft.com...[color=blue]
    > I've got a program that I run -- it's under the control of a form. Part
    > of
    > the process is fairly lengthy (10 minutes). The form has a control that
    > lets
    > me know how far it's gotten.
    >
    > My problem is that if I switch to, say, e-mail and then try to get back to
    > my form it will not appear until it finishes the lengthy step.. When I
    > update the control (with the status) I tell the form to refresh. Is there
    > something else I need to do so that I can switch away from the application
    > and then go back to it again and see the status?
    >
    > I'd appreciate any suggestions.
    >
    > Art[/color]


    Comment

    • Art

      #3
      Re: refreshing the screen

      Scott,

      Thanks -- the "easy way" seems to work for me. I put DoEvents in the same
      step that updates my status control.

      Art

      Comment

      Working...