Click here to Skip to main content
12,551,157 members (46,545 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#
how to go through this article? the writer is not rplying can any expert help us out
Minimize window to system tray[^]

First I drag a notifyicon from toolbox to form, and set the icon in property. Then I paste your code to the form as below:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace minimizeTray
public partial class TrayMinimizerForm : Form
public TrayMinimizerForm()
private void TrayMinimizerForm_Load(object sender, EventArgs e)
private void TrayMinimizerForm_Resize(object sender, EventArgs e)
notifyIcon1.BalloonTipTitle = "Minimize to Tray App";
notifyIcon1.BalloonTipText = "You have successfully minimized your form.";
if (FormWindowState.Minimized == this.WindowState)
notifyIcon1.Visible = true;
else if (FormWindowState.Normal == this.WindowState)
notifyIcon1.Visible = false;
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
this.WindowState = FormWindowState.Normal;
is there anything else which i forgot?
thanks in advance
Posted 24-Sep-12 9:24am
Lakhan Aanjana 24-Sep-12 15:29pm
if u r getting any error message please let me know?
sariqkhan 24-Sep-12 15:43pm
no there is no errors but the problem is when form is clicked on minimized it goes to hidden in the system. but the actual coding is form should go in system tray. and a ballon messsage will shows up
Minimize to Tray App
you have successfully minimized your form.
which is not happening. is there some problem in code?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You need to set event of your form ReSize to >> TrayMinimizerForm_Resize code
sariqkhan 25-Sep-12 5:53am
it is the form resize event only
Kuthuparakkal 25-Sep-12 5:58am
Debug with break points on on the event and find what's happenin there?
sariqkhan 25-Sep-12 13:54pm
what will break point do?
Marcus Kramer 25-Sep-12 14:18pm
A break point will allow you to debug your code to find out where the problems are. See this for details.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.161021.1 | Last Updated 26 Sep 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100