C# 窗体点击关闭按钮时最小化到托盘
private void form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.CloseReason == CloseReason.UserClosing)
{
e.Cancel = true;
this.Hide();
TaskIcon.BalloonTipTitle = "分诊系统";
TaskIcon.BalloonTipText = "程序还在继续运行......" + "\r\n" + "单击托盘图标还原窗口.";
TaskIcon.ShowBalloonTip(2000);
}
}
{
if (e.CloseReason == CloseReason.UserClosing)
{
e.Cancel = true;
this.Hide();
TaskIcon.BalloonTipTitle = "分诊系统";
TaskIcon.BalloonTipText = "程序还在继续运行......" + "\r\n" + "单击托盘图标还原窗口.";
TaskIcon.ShowBalloonTip(2000);
}
}