窗体像QQ那样最小化到托盘 ,下面是代码  怎么不对啊,  是不是还需要设置什么属性啊?  高手给帮忙改下            private void MainForm_Resize(object sender, EventArgs e)
        {
            if (this.WindowState == FormWindowState.Minimized)
            {
                this.WindowState = FormWindowState.Normal;
                notifyIcon1.Visible = true;
                this.Hide();
                this.ShowInTaskbar = false;
            }
        }        private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)
        {
            if (this.ShowInTaskbar == false)
                notifyIcon1.Visible = true;                this.ShowInTaskbar = true;
                this.Show();
                this.Activate();  
                this.WindowState = FormWindowState.Normal;
            
        } 

解决方案 »

  1.   

    http://www.cnblogs.com/xugang/archive/2007/12/19/1006005.html
      

  2.   

            private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
            {
                if (this.Visible)
                {
                    this.Hide();
                }
                else
                {
                    this.Show ();
                    this.WindowState = FormWindowState.Normal;
                }
            }        private void Form1_SizeChanged(object sender, EventArgs e)
            {
                if (this.WindowState == FormWindowState.Minimized)
                {
                    this.Hide();
                    this.notifyIcon1.Visible = true;
                }
            }