1. Set the form attribute showintask = false
2. Add a Notifyicon Control Notifyicon1 to add an ICON icon to the property Icon's property icon.
3. Add a form minimize events (first you need to add event references):?
// this.sizechanged = new system.eventhandler (this.form1_sizechange;
// The above line is a reference to the main form initializeComponent () method.
? private void form1_sizechanged (Object sender, Eventargs e) ?? {??? if (this.WindowState == FormWindowState.minimized) ??? {???? this.hide (); ???? this.notifyicon1. Visible = true; ???}
??} 4. Add click icon events (first you need to add event references):
?? private void notifyicon1_click (Object sender, eventargs e) ?? {??? this.visible = true;
??? this.windowstate = formwindowstate.normal;
??? this.notifyicon1.visible = false; ??}
?
5. You can add the right-click menu for Notifyicon:
The main form is dragged into a ContextMenu control ContextMenu1, point control, add menu in the context menu, and select ContextMenu1 as the context menu in the context menu.
(You can add behavior in the submenu)