Welcome to MSDN Blogs Sign in | Join | Help

Creating an icon in the system tray

A standard part of many Windows forms applications is the system tray icon. Most commonly it is used to provide an application or event status. Tray icons are added to an application using the NotifyIcon control. It includes properties that simplify displaying a System Tray icon and the notification "balloon". Once you've added the control to your form, assign an icon (.ico) file or image to its Icon property, and ensure that its “Visible” property is set to “True”.

As an example let’s create a simple application that creates a tray icon using Visual Studio 2008.

Create a new Windows Form project

On the main form add a button and a NotifyIcon to the project.

Update the following properties on the NotifyIcon1 control

In the Button1 code place the following code to make the balloon show for six seconds

Once the application is run and the button is pressed it shows the following

Published Wednesday, December 05, 2007 9:27 PM by trobbins

Comments

# Free People Searches » Creating an icon in the system tray

Wednesday, December 05, 2007 10:38 PM by Free People Searches » Creating an icon in the system tray

# Free People Searches » Creating an icon in the system tray

Wednesday, December 05, 2007 10:38 PM by Free People Searches » Creating an icon in the system tray

# Creating an icon in the system tray - does this work in WPF apps too?

Thursday, December 06, 2007 7:34 AM by Neil

Hi Thom,

I noticed your instructions said to create a Windows Forms app - do you know if there's a similar process for WPF apps to work with system tray icons?

Cheers,

Neil

# Interesting Finds: December 6, 2007

Thursday, December 06, 2007 9:57 AM by Jason Haley

# re: Creating an icon in the system tray

Friday, December 14, 2007 1:34 AM by Chandan Kumar

Thanks for the code I have used it but i could not find any icon on system Tray. can you please tell me how to display application in the System Tray.

# re: Creating an icon in the system tray

Saturday, December 15, 2007 3:46 PM by trobbins

Not sure what may be the problem. If you have run the code you should see the icon in the system tray and a balloon that should pop up.

# re: Ridiculous tiny icons in system tray

Thursday, December 20, 2007 7:51 AM by frank bailey

Since a recent problem with my ati driver, i have tried to restore my screen to how i like it. (resolution=1280x1024).

However i now have two rows of ridiculously small icons in the Sytem Tray, instead of one row or decent sized ones. There is only ever 7 or 8 'live' icons present.

Does anybody know what i have done? And how to get it back to ONE row??

New Comments to this post are disabled
 
Page view tracker