Make System Tray Based Application in .NET
Creating an application that lives in the system tray is easy, but it is not entirely obvious how to do so in Visual Studio. This recipe will show you the steps.
1) First, create a new Windows Application project in Visual Studio.NET. This can be either Visual Basic or C#
2) Drag a Notifyicon control and a ContextMenu control from the toolbox onto the form.
3) Click on the NotifyIcon control that you just added, and set the Icon property to whatever icon you want your application to have.
4) Set the ContextMenu property of the Notifyicon to the context menu that you added to your project.
5) Right click on the Context Menu control, and select Edit. Since this menu will be the right-click menu for your tray icon, you will want to add the items that the user will see. Make sure to add an Exit menu item.
6) Double click the Exit menu item, and add the following code:this.Close();
7) Now for the important settings. Click on the form, and go to the Properties window. Set the following settings:
FormBorderSize: Fixed Tool Window
WindowState: Minimized
Opacity: 0%
ShowInTaskbar: False
The key thing to remember is that the default form is not to be used for application functionality, it is only used as the hidden background window. If you want to create a new window, you can just add another form to your application.







Amrita said on December 1, 2008
That is cool!!!
0p1e said on April 22, 2009
Awesome, just what I needed.
Thanks!
Tom said on May 8, 2009
Nice job- thanks for the info!
TY said on July 4, 2009
THANKS!
hacker said on October 26, 2009
Thanks! Works perfect!
Anonymous said on April 28, 2010
thank you.
None said on May 4, 2010
Just what I needed, much appreciated.
Abcd said on July 6, 2010
thank u very much..very good one
Seth Adam Davis said on March 1, 2011
Wow. Great tut! Easy and straightforward.
hahahut said on March 1, 2011
Awesome! Just what I need!
John Bryntze said on April 2, 2011
Even I could do it with this description, then anyone can, thanks a lot, this is super cool
ddonate said on September 21, 2011
Thanks a lot!! Easy & complete…
Dave said on December 15, 2011
Thanks so much, I can’t believe how simple it is to get a tray app up and running.