我在VS2008中写了个winform程序,想实现关闭按钮,就最小化到托盘

在form.cs文件中我自己写了
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
this.Visible = false;
notifyIcon1.Visible = true;
e.Cancel = true;

}
但是为什么点击关闭后,自动退出程序的?我的目的是点击关闭,最小化到托盘

this.Visible = false;
换成
this.Hide();
看看呢
有问题你可以hi 我
温馨提示:答案为网友推荐,仅供参考
第1个回答  2010-08-09
你的代码我试了,程序没有退出。你再仔细检查一下其它部分的代码,也许有别的代码导致了你的程序退出。
相似回答