views:

385

answers:

5

I want to make my .Net application display a notification in the system tray. So I want to show an icon for that, can anyone tell how to do that?

A: 

In .Net apps you can specify the file to use as an icon - it can be a bitmap or png etc. so just use your favourite image editing program to create you icon.

This article gives advice on getting your app to put an icon in the system tray.

Hope this helps.

xan
+6  A: 

Open the main Form for your application, go to the Toolbox, open the All Windows Forms section and drop a NotifyIcon on your form. Then add the icon you want to the NotifyIcon.

You may also want to change the ShowInTaskbar property of your form to false when the form is minimized and handle the double click event of the NotifyIcon to restore your form and set ShowInTaskbar back to true.

Rob Prouse
+2  A: 

You need to add a NotifyIcon to your Windows Form and set the Icon property to an appropriate icon, set the ShowInTaskBar property of the form to false.

You will probably also want to handle the form closing event and hide rather than close the form; adding a ContextMenuStrip to the NotifyIcon will allow you to provide a context menu with options like Exit and Settings with the appropriate handlers.

Gordon Mackie JoanMiro
A: 

Here is a related discussion.

itsmatt
A: 

Please see this it covers all combinations of mouse clicks with NotifyIcon as well as much more. The code is located in a template and is project setting driven so that you can implement NotifyIcon logic in all your projects with no coding effort at all.

More Here

http://code.msdn.microsoft.com/TheNotifyIconExample