I am using a ProgressBarEx in an app that so far has been working very well. But now I want to enable 'waiting' on the progress bar while performing some intensive computing of unknown length. This computing must be performed on a UI thread. Doing so, however, freezes up the waiting animation of the progress bar because ProgressBarEx uses System.Windows.Forms timers. This seems to contradict the very nature of a 'waiting' progress bar. What am I missing?
BTW, I looked at the activity bar sample on GotDotNet, but that sample does not use System.Windows.Forms timers - it uses an entirely separate thread for the animation that sleeps for small increments of time.
RPRamesh Praveen Syncfusion Team May 5, 2003 06:58 AM
I am not sure how you can update the UI when your UI thread is processing a huge op! Could you post the sample where it works with the ActivityBar?
TFTerry FosterMay 5, 2003 02:01 PM
I didn't ever get it to work with the activity bar, although I suspect I could. I really want to use the syncfusion progess bar, though. What you mention, however, is really the problem I'm facing: I can't be updating the UI if my UI thread is tied up. I guess what I'm wondering is why does the syncfusion progress bar use a system timer to animate 'waiting' when it is very convenient to do the intensive processing of unspecified length on the UI thread (e.g. UI is unresponsive during waiting which is desirable for my case). Instead, it appears that you are always assuming that the intensive processing must be performed on a separate thread, which is extremely inconvenient (or impossible) for my case. Any suggestions for a workaround?
RPRamesh Praveen Syncfusion Team May 6, 2003 06:41 AM
Which ever timer or thread we use the bottom line is that the final UI update has to happen in the UI thread. So when you perform a huge op., the UI thread blocks and the UI cannot be updated.
But, you could workaround by calling Application.DoEvents in the middle of your huge op. (hope that's possible in your case). This will process any pending paint messages. It will however enable mouse processing, etc. so you might have to disable your UI manually.
Do let me know if this works.
TFTerry FosterMay 7, 2003 09:16 AM
Ah - this is the stuff I needed to know. Now I know what I need to do. Thank you very much.
RPRamesh Praveen Syncfusion Team May 7, 2003 01:45 PM