C# winForm启动最小化到任务栏右侧通知栏并交互操作
//二 雙擊窗體上的菜單項,添加相關代碼
??????? private void exitMenuItem_Click(object sender, EventArgs e)
??????? {
??????????? if (MessageBox.Show("你確定要退出程序嗎?", "確認", MessageBoxButtons.OKCancel, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.OK)
??????????? {
??????????????? notifyIcon1.Visible = false;
??????????????? this.Close();
??????????????? this.Dispose();
??????????????? Application.Exit();
??????????? }
??????? }
??????? private void hideMenuItem_Click(object sender, EventArgs e)
??????? {
??????????? this.Hide();
??????? }
??????? private void showMenuItem_Click(object sender, EventArgs e)
??????? {
??????????? this.Show();
??????????? this.WindowState = FormWindowState.Normal;
??????????? this.Activate();
??????? }
總結
以上是生活随笔為你收集整理的C# winForm启动最小化到任务栏右侧通知栏并交互操作的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《架构之美》笔记
- 下一篇: 这段代码,c 1秒,java 9秒,c#