How to process waiting window messages during a loop?

The standard way of allowing Windows messages to be processed is to call Application.DoEvents method. However, the Application class in WPF does not have a DoEvents method. So, what you need is to find a way of calling this method, or an alternative method! Actually, it is surprisingly easy to do so: Instead of calling
Application.DoEvents();
you can call:
System.Windows.Forms.Application.DoEvents();
This will work as desired!

Leave a comment

Up ↑