Create a System Tray Application

Problem

You want to create an application that displays an icon in the system tray and runs in the background.

Solution

Start your application with a component class that includes the NotifyIcon control. Show other forms if needed when the user clicks on the NotifyIcon control or selects a context menu option.

Discussion

System tray applications are usually long-running applications that run quietly in the background, possibly performing some periodic task or waiting for an event (such as the creation of a file or a notification from the operating system). System tray applications might provide a user interface, but they don’t present it on startup. Instead, they create an icon in the system tray and then wait for user ...

Get Microsoft® Visual Basic® .NET Programmer's Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.