None.gif private void Form1_Deactivate(object  sender, EventArgs e)
ExpandedBlockStart.gifContractedBlock.gif        
dot.gif
{
InBlock.gif            
if (this.WindowState ==
 FormWindowState.Minimized)
InBlock.gif                
this.Visible = false
;
ExpandedBlockEnd.gif        }

还有种方法更加直接,重载WndProc:

None.gif const int WM_SYSCOMMAND = 0x112 ;
None.gif
const int SC_CLOSE = 0xF060
;
None.gif
const int SC_MINIMIZE = 0xF020
;
None.gif
const int SC_MAXIMIZE = 0xF030
;
None.gif
protected override void WndProc(ref
 Message m)
ExpandedBlockStart.gifContractedBlock.gif
dot.gif
{
InBlock.gif    
if (m.Msg ==
 WM_SYSCOMMAND)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif
{
InBlock.gif        
if (m.WParam.ToInt32() ==
 SC_MINIMIZE)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif
{
InBlock.gif            
this.Visible = false
;
InBlock.gif            
return
;
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif    }

InBlock.gif    
base.WndProc(ref m);
ExpandedBlockEnd.gif}