after the Ballon Tip of my NotifyIcon has been close the icon still stays in tray. It vanishes only when I hover it with my mouse cursor.
I have a class Notification.cs which has one component - NotifyIcon.
I call it from my Console Application as I only want to show the notification when certain conditions are fulfilled.
Some code:
how I call the notification from within my program:
Notification not = new Notification("Error occured, do this or that", "Some error", System.Windows.Forms.ToolTipIcon.Error); not.getIcon().ShowBalloonTip(1000);
the notification class:
public Notification(string baloonTipText, string baloonTipTitle, System.Windows.Forms.ToolTipIcon icon) : this() { this.icon.Visible = true; this.icon.BalloonTipText = baloonTipText; this.icon.BalloonTipTitle = baloonTipTitle; this.icon.BalloonTipIcon = icon; } public System.Windows.Forms.NotifyIcon getIcon() { return this.icon; } private void icon_BalloonTipClosed(object sender, EventArgs e) { this.icon.Visible = false; this.icon.Dispose(); }
Any ideas?
type
is theNotification
class? – FootwayRefreshTaskbarNotificationArea()
inicon_BalloonTipClosed
method doesn't work for me. I have to call it externally, which is not a good option @hvd yes, the main program is still running - I instantiate the Notification class, get it's icon and show the balloon tip only to tell the user sth went wrong @BigM I don't really understand your question. It's a class I created in VS using the Component Class Template – Grizzle