`
king_tt
  • 浏览: 2122416 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

winform最小化后隐藏到右下角,单击或双击后恢复

 
阅读更多
notifyIcon控件。下面的代码
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;
            
        }

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics