I have a Windows Forms application using .NET 4.5.2 and I'm creating a PopupNotifier
that I create in code:
PopupNotifier popup = new PopupNotifier();
popup.TitleText = "Title here";
popup.ContentText = "Content here";
popup.Popup();
This popup is meant to alert the user of 'milestones' in the application's progress when the application was called as a scheduled task with no visible GUI, which I'm hiding with the following code when the form loads:
BeginInvoke(new MethodInvoker(delegate {
Hide();
}));
The problem is that all the popups back up in a queue or something. It appears they won't popup until the method they were called in finishes executing, and the UI thread is again the primary processing focus as the application is more or less idle. But I'm not sure exactly why.
I've tried solutions such as invoking the popup from the form's UI thread like suggested in this answer with no luck. Is there a line or block of code I can call to force the popup to show? Something like Application.DoEvents()
(except, you know, something that works to force the popup to show).
Thanks for the help!