private void Form1_Resize(object sender, EventArgs e)
        {
            if (this.WindowState == FormWindowState.Minimized)//最小化到系统托盘
            {
                notifyIcon1.Visible = true;//显示托盘图标
                this.Hide();//隐藏窗口
            }
        }

        private void notifyIcon1_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                this.Show();
                WindowState = FormWindowState.Normal;
                this.Focus();
            }
        }

        private void label_min_Click(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized;
        }

        private void label_close_Click(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized;//使关闭时窗口向右下角缩小的效果
        }

 

相关文章:

  • 2021-11-01
  • 2021-08-31
  • 2022-12-23
  • 2021-11-30
  • 2021-08-11
  • 2022-12-23
  • 2021-10-02
  • 2021-06-07
猜你喜欢
  • 2021-11-02
  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
相关资源
相似解决方案