放一个NotifyIcon控件,给他一个ICON图标(就是你想显示托盘图标) ,正常窗体时设置不可见。
在它的点击时间里 让窗体显示
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
this.Hide();//窗体消失
//令其可见
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
this.Hide();
} private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
this.Show();
}