How to display an icon in the system tray?

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

+1


source to share


4 answers


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



You can also change your form's ShowInTaskbar property to false when the form is minimized and handle the NotifyIcon double-click event to restore the form and return ShowInTaskbar to true.

+7


source


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



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

+2


source


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

This article gives advice on getting your application to place an icon in the system tray.

Hope it helps.

0


source


Note that it covers all combinations of mouse clicks with NotifyIcon, as well as more. The code resides in the template and is driven by the project setting so you can implement the NotifyIcon logic across all your projects without any coding effort.

More details here

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

0


source







All Articles