Re: Using DoEvents in WPF
This really isn't the way to do things. DoEvents or anything like it should be avoided at all costs because it can cause all sorts of problems (re-entrancy of code etc etc).
What you really should be doing is having a separate thread which your long-running task is on.
The sequence of operation should be something like :
1. Display "Please wait"
2. Disable all controls relevant.
3. Fire thread
4. Thread starts long running task
5. When finished thread signals back to UI that it's finished.
6. UI hides "Please wait".
Have a look at the BackgroundWorker class which simplifies a lot of this stuff for you.
There are loads of pages on the net to help too. Have a google for "WPF asynchronous method" or something like.
Yours,
Darwen.
Re: Using DoEvents in WPF
Thanks. I'll try that approach, too. I did get it working properly using my created DoEvents() method. I like the BackgroundWorker approach. It sounds more logical.
Sutton