1. Add NotifyIcon and ContexMenuStrip from the toolBox to the window Form
2. Set the following properties of the NotifyIcon from the property window:
3. Take a Button and write the code in its click event
private void button1_Click(object sender, EventArgs e)
{
//display menustrip
notifyIcon1.ShowBalloonTip(1);
//hide form
this.Visible = false;
}
4. Add a menu item in ContenxMenuStip : Close and add the click event of menu item this way:
private void CloseToolStripMenuItem_Click(object sender, EventArgs e)
{
//hide menustrip
notifyIcon1.Visible = false;
//display form
this.Show();
}