111,129
社区成员
发帖
与我相关
我的任务
分享
设置窗体属性
windowstate为Minimized
showintaskbar 为 false
在窗体form_load方法添加以下代码
this.Hide();
在notifyicon的mouseclick方法添加以下代码
this.Show();
this.ShowInTaskbar = true;
this.WindowState = FormWindowState.Normal;
在窗体form_formclosing方法添加以下代码
if (e.CloseReason == CloseReason.UserClosing)
{
//在窗体上点击关闭按钮程序不会退出,需自己添加退出方法
e.Cancel = true;
this.ShowInTaskbar = false;
this.Hide();
}