Right-click any empty space on your taskbar and select Taskbar Settings . Expand the menu.
ContextMenuStrip menu = new ContextMenuStrip(); menu.Items.Add("Exit", null, (s, e) => Application.Exit()); trayIcon.ContextMenuStrip = menu; system tray icon
However, system tray icons can also have some drawbacks: Right-click any empty space on your taskbar and
Right-click any empty space on your taskbar and select Taskbar Settings . Expand the menu.
ContextMenuStrip menu = new ContextMenuStrip(); menu.Items.Add("Exit", null, (s, e) => Application.Exit()); trayIcon.ContextMenuStrip = menu;
However, system tray icons can also have some drawbacks: