using System.Windows.Threading; namespace System.Windows.Forms { public static class Application { public static void DoEvents() { Dispatcher.CurrentDispatcher.Invoke(() => { }, DispatcherPriority.ContextIdle); } } }