MSDN Archive Home
Help and FAQs
TheNotifyIconExample - C# Project Template for NotifyIcon and Taskbar Example
All Resource Updates
Change History (all pages)
TheNotifyIconExample is a Visual C# Project Template that defines, manages, and supports code-free modification of NotifyIcon, TaskBar, Mouse Clicks, ContextMenuStrips, Startup and Exit Logic, all managed without any code changes, or builds, ever, using Visual Studio Project User Settings for any projects now or in the future.
Think of all the time you will save, on each and every project in the future, by not doing the same thing over and over for every project. Create projects 3, 4 and 5 times faster.
No code change or re-build is ever required after changing any setting.
Never waste time on any project designing any of this totally redundant code, ever again. Have it ready to go, from the second your projects are created now and in the future and all instantly changeable without any code changes using Visual Studio Project User Settings.
Two templates are provided, one with and one without comments. Other than that, both templates are the same.
Works with all versions of Microsoft Visual C# including Express Editions.
Includes ClickOnce deployment and automatic-updates technology in project properties for web server and web site deployment, simple change the web site name.
There is no need to install the demo project below, unless you would like to see the ClickOnce deployment ability contained in the templates. You can just jump to installing the templates if you wish.
Here is a demo project made with these templates using ClickOnce deployment and auto-update technology.
Click to Install
this demo project can be removed at anytime using your Windows control panel and add/remove programs. If you do not have .NET 3.5 installed, please allow ClickOnce to install it for you.
You will need some version of Microsoft Visual C# installed to install these templates properly.
If you don't have a version of C# already installed and you would like the latest version of Microsoft Visual C# 2008 Express Edition for FREE please
for the latest versions of C# 3.0 and .NET 3.5(SP1).
Install both project templates by
Click Open or Run to install both templates.
Default Visual Studio Project User Settings for the demo Project and the TheNotifyIconExample Visual Studio C# Project Templates are set to these settings by default. You can change them to anything you want for any project you wish:
How To Use TheNotifyIconExample
Open Visual C# - From there:
File -> New Project -> ("From My Templates") Select TheNotifyIconExample with Comments") -> Name your project -> Click the OK Button.
In the Solutions Explorer window, right-click on Form1.cs and choose View Code.
Read the comments to see how TheNotifyIconExample templates work.
On the top Menu of Visual Studio C# Choose:
Build -> Build Solution
Debug -> Start Debugging
Project ("Your Project Name") Properties -> Settings
Use your mouse to expand/collapse the columns here and view the current default settings for TheNotifyIconExample, any of these settings can be changed on the far right, under value, by clicking false or true, and changing the ListBox for any setting to the opposite of what the setting currently is set to now. To see your changes take place simply do:
Debug -> Stop Debugging
Debug -> Start Debugging
Exit Visual Studio at any time, as usual, to save or discard the current project or solution. It's that easy, to use these Visual Studio C# project templates, for any of your projects, now or in the future.
The project template with comments, was very heavily commented so that people using other programming languages could read, understand and utilize the same concepts easily, as well, in other programming languages, since the source code in the templates are both functional and educational on the use of best methods for:
NotifyIcon, Taskbar, ContextMenuStrip, Mouse Clicks for both single and double, Left and right, Form, NotifyIcon, ContextMenuStrip events.
Sharing ContextMenuStrip between Form and NotifyIcon, as well as using unique and mutiple ContactMenuStrips for Form and NotifyIcon based on Mouse Click.
Different startup and exit logic, including starting displaying the Form as normal or minimized, with or without a Taskbar for normal and minimized mode.
Restricted Exit, meaning the "X" on Forms is not honored as an exit request, and instead the program or application is minimized to the System Tray as an Icon.
Totally restricted exit, with our without a splash Form, which allows programs to be displayed as running in the System Tray, but not stoppable via normal GUI methods. Great for programs that start at startup, where you want the users to see that the program or application has started, and is running, but not allow the program or application to be stopped using normal GUI methods.
Total GUI invisibility, for those programs that don't want any visible sign they are running.
Single instance restricted, so that only one copy per system of the aplication or program will run at one time.
How to use Visual Studio Project Settings in your projects and avoid the need of any registry usage.
How to modify, and save any Visual Studio Project Settings for next runtime and allow your users to do the same as needed.
ClickOnce deployment and automatic-program update technology practices from web sites or web servers on the Intranet or Internet.
Methods to create Visual Studio Templates and Starter Kits.
How to use and deploy Visual Project Templates and Startup Kits using normal zip files and vsi files for the Visual Studio Community Content Installer.
For a real-life example of NotifyIconExample above and beyond a "Demo Project" please see this resource in the MSDN code gallery as well: SEHE Skpe Event Handler Example -
Dec 3 2008 at 12:10 AM
, version 45
Apr 10 2010 at 8:46 AM
Hey take a look at Program.cs (lines 55-56)
"if (Assembly.GetExecutingAssembly().Location.Replace("/", "\\") ==
this statement is always true!!
Sep 24 2010 at 11:23 PM
Visual Studio Builds Program.cs
Jan 24 2011 at 7:56 AM
any updates in 2011 ?
Feb 3 2012 at 5:58 AM
No everything still works as is.
Sign in to add a comment
Wed Nov 26 2008 at 8:00 AM
More Tags ...
Visual Studio 2005
Visual Studio 2008
Visual Studio 2010
Manage Your Profile
MSDN Flash Newsletter
© 2008 Microsoft Corporation. All rights reserved.