二、最小化到系统托盘
拖一个NotifyIcon
设置form的showInTastbar属性为false
this.SizeChanged += new System.EventHandler(this.Form1_SizeChanged);
private void Form1_SizeChanged(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Hide();
this.notifyIcon1.Visible = true;
}
}
private void notifyIcon1_Click(object sender, EventArgs e)
{
this.Visible = true;
this.WindowState = FormWindowState.Normal;
this.notifyIcon1.Visible = false;
}