Sunday, June 20, 2010

Show Icon in Taskbar (Trayicon)

If one adds the control NotifyIcon to a Windows Forms-Application, then while running the program a symbol is shown in the info area in the right part of the taskbar, a so called TrayIcon.
The icon can be determined via the property Icon of the control, the tooltip via the property Text.
If one further adds a control of type ContextMenuStrip, this menu can be added to the icon by setting the property ContextMenuStrip of the NotifiyIcon.
If the user then right clicks on the icon, the previously created menu from the connected control is then shown.

No comments:

Post a Comment