DoEvents for a single form?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a single process that takes a little time but is necessarily blocking.
So I pop up a little progress window and periodically update a label as I go
along. I use the progress window in several places, so I don't have the
luxury of opening in with ShowModal().

The problem is, of course, Update()ing the progress form after I set the
label's text only works if the user has never alt-tabbed away from the
progress window. The Application.DoEvents() works great, except that it
allows code re-entry.

Code re-entry would not be a problem if only the messages being sent to the
progress form were being processed.

Is there some kind of DoEvents() for a single form?



~BenDilts( void );
 
BeanDog said:
I have a single process that takes a little time but is necessarily blocking.
So I pop up a little progress window and periodically update a label as I go
along. I use the progress window in several places, so I don't have the
luxury of opening in with ShowModal().

The problem is, of course, Update()ing the progress form after I set the
label's text only works if the user has never alt-tabbed away from the
progress window.

That shouldn't be a problem. So long as you're only running the one
message thread, you shouldn't need to do anything else.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
 
Back
Top