C # Hide the window appllication as the taskbar icon when writing the minimal code.
1. Set the winform attribute showintask to false.
2. Add the policyicon control policyicon1 to add an icon for the property icon of the control policyicon1.
3. Add a form minimization event (you must first add an event reference ):
This. sizechanged + = new system. eventhandler (this. form1_sizechanged );
// The above line is the reference to be added in the main form initializecomponent () method
Private void form1_sizechanged (Object sender, eventargs E)
{
If (this. windowstate = formwindowstate. Minimized)
{
This. Hide ();
This. policyicon1.visible = true;
}
}
4. Add a click icon event (you must first add an event reference ):
Private void policyicon#click (Object sender, eventargs E)
{
This. Visible = true;
This. windowstate = formwindowstate. normal;
This. policyicon1.visible = false;
}
From:
Http://www.blogchinese.com/user1/38506/archives/2006/200672310146.shtml