How to place C#.Net windows application to System Tray?

This tutorial explains, how we can place a windows application to System Tray using C#.Net.

Place C#.Net windows application to System Tray

In this example we will see when the user minimizes the form then the form will reside in the System Tray.

Follow the below steps to place C#.Net windows application to System Tray.

Create a form (Right click on the Project, then Click on Add -> Add Windows Form…)

Then drag and drop an NotifyIcon from the Toolbox. And then Right click on the NotifyIcon and click on Properties. There you can give a proper name, also you can upload an icon (.ico) file and then you can set the Text property which will appear when the user put the cursor on the NotifyIcon. It should be look like below:

Now generate the event handler for the Resize evernt of the form and write the below code:

Here If the user click on Minimize it will hide the form.

private void Form1_Resize(object sender, EventArgs e)
        if (FormWindowState.Minimized == WindowState)

Now generate an event handler for the DoubleClick event of the NotifyIcon and write the below code.

Here when user doubleclick on the NotifyIcon then it will show the form.

private void notifyIcon1_DoubleClick(object sender, EventArgs e)
 WindowState = FormWindowState.Normal;

Now run the application and click on minimize, then the form will place in the System tray.

You may like following C#.Net tutorials:

Hope this tutorial explains, how to place C#.Net windows application to System Tray?

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.