Thursday, January 05, 2012 11:40 AM
I use a notification balloon in my application to alert users about a specific event.When the BalloonChangedEvent is fired, I dispose the notification.
When I call notification from the UI (e.g. a button click), the balloon is disposed correctly but when I call it from a background thread, the event never fires up.
Friday, January 06, 2012 6:27 PM
- Raise and event in your background thread.
- Add a handler for that event to your UI code.
- Inside the event code handler, Invoke a Delegate method to change the state of the UI. You cannot change the UI directly from the event, you must Invoke a Delegate to allow the STAThread process to execute the change.
Dick Grier. Author of Visual Basic Programmer's Guide to Serial Communications 4. See www.hardandsoftware.net.
Monday, January 09, 2012 9:20 AM
Thank you for your answer.
I finally used Action class to show the nofitication
Invoke(new Action(() => ShowMessage()));
and it worked perfect.
- Marked As Answer by Aristeidis Bampakos Monday, January 09, 2012 11:39 AM