First, of course, the Notifyicon control is to be introduced. private System.Windows.Forms.NotifyIcon notifyIconServer; this.notifyIconServer = new System.Windows.Forms.NotifyIcon (this.components); then set the properties of the various control: // // notifyIconServer // this.notifyIconServer.ContextMenu = This.ContextMenutRay; // Specifies the context menu this.notifyiconserver.icon = ("NOTIFYICONSERVER.ICON)))); // Specify the icon this.text =" My Server "; // specified hover display this.notifyIconServer.MouseDown = new System.Windows.Forms.MouseEventHandler (this.notifyIconServer_MouseDown); this.notifyIconServer.DoubleClick = new System.EventHandler (this.notifyIconServer_DoubleClick); // / / contextMenutray context menu // this.contextMenut.Menuitems.addrange (new system.windows.forms.Menuitem [] {this.Menuitem1, this.Menuitem2}); /// Menuitem1 // this.Menuitem1.index = 0; THIS.MENUITEM1.TEXT = "Open Chat Server"; this.Menuitem1.click = new system.eventhandler (this.Menuitem1_click); // // Menuitem2 // TH Is.Menuitem2.index = 1; this.Menuitem2.text = "Exit"; this.Menuitem2.click = new system.eventhandler (this.Menuitem2_click); When the user clicks the "Off" button of the form, it is not Really close the form, but put the program to the system tray.