Author Topic: Any alternative to DoEvents()?  (Read 2216 times)

0 Members and 1 Guest are viewing this topic.

Viktor

  • Guest
Any alternative to DoEvents()?
« on: January 11, 2010, 02:05:35 PM »
So I have a wpf tool palette control, and when the control is busy processing I'd like to inform the user of the progress, but the palette does not update until the process is done. The way I take care of it right now is by using System.Windows.Forms.Application.DoEvents(), but this does slow down the app a bit.

I don't fully understand what "DoEvents" does and why its not very predictable, but is there an alternative to this? Is there another way to display progress that is on another thread or something?

I kind of imagine DoEvents to pause my code and pass through any awaiting processes, then continue with my code, which would explain why sometimes its a very small delay and other times its a bit bigger.

Thanks,
Viktor.