I needed to update the system tray icon's text value, of my application, whenever a user hovers over it. I noticed that no such event exists for system tray icons. Is it possible to create a hover event for a system tray icon and if so how can I go about accomplishing it?
views:
132answers:
2
+5
A:
How about hooking into NotifyIcon.MouseMove
?
As a basic example, this seems to work (with a NotifyIcon
on a Form
):
public Form1() {
InitializeComponent();
notifyIcon1.MouseMove += delegate
{
notifyIcon1.Text = DateTime.Now.TimeOfDay.ToString();
};
notifyIcon1.Icon = SystemIcons.Hand;
notifyIcon1.Visible = true;
}
Marc Gravell
2009-05-27 08:26:00
Hey Marc - good to see they made you a mod!
Dead account
2009-05-27 08:27:25
Indeed, but I was going for "rocker" ;-p
Marc Gravell
2009-05-27 08:33:49
A:
In WPF, UI Elements have a ToolTipOpening/ToolTipClosing event. You should update the tooltip text in the opening. I don't know if system tray icons have such behavior, but i guess there is something similar.
rockeye
2009-05-27 08:27:31