2019年6月14日 星期五

視窗縮小到工具列


C#.Net 視窗縮小到工具列

        #region 使用NotifyIcon視窗縮小到工具列
        private void BtnFormMini_Click_1(object sender, EventArgs e)
        {
            this.BtnFormMini.Click += Form1_Resize;
        }

        private void NotifyIcon1_Click(object sender, EventArgs e)
        {
            this.Visible = true;
            this.WindowState = FormWindowState.Normal;
            this.NotifyIcon1.Visible = false;
        }
        private void Form1_Resize(object sender, EventArgs e)
        {
            this.Hide();
            this.NotifyIcon1.Visible = true;
        }
        #endregion

沒有留言:

張貼留言