C#实现窗体最小化到状态栏,双击运行时又能正常显示窗体

【转载】
首先在窗体中添加一个 notifyIcon1控件
,
Then:
//添加事件《实现最小化之后任务栏显示图标》
        private void Form1_StyleChanged(object sender, EventArgs e)
        {
            if (this.WindowState == FormWindowState.Minimized) 
            {
                this.notifyIcon1.Visible = true;
                this.Visible = false;
            }
        }
//双击图标之后显示窗体
     private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
         {
            this.Visible = true;
            this.WindowState = FormWindowState.Normal;
            this.notifyIcon1.Visible = false;
        }
原文地址:https://www.cnblogs.com/masonchi/p/3446051.html