请教用c#写的窗体程序,请教怎样实现程序运行自动缩小到系统托盘里?点击系统托盘的图标程序又正常显示出来,点程序的最小化和关闭按钮程序自动缩小到托盘里,就像qq一样?

解决方案 »

  1.   

    托盘
    private void Form1_SizeChanged(object sender, EventArgs e)  
    {  
      if(this.WindowState == FormWindowState.Minimized)  
      {  
      this.Hide();  
      this.notifyIcon1.Visible=true;  
      }  
    }private void notifyIcon1_Click(object sender, EventArgs e)  
     {  
      this.Visible = true;  
      this.WindowState = FormWindowState.Normal;  
      this.notifyIcon1.Visible = false;  
     }