最小化问题
我想把我做好的窗体点击最小化后出现在电脑的托盘区怎么做啊
通过NotifyIcon控件实现,具体代码如下:
private void button_Click(object sender, EventArgs e)
{//最小化
this.Hide();//隐藏
//this.NotifyIcon1.Text = this.Text;
this.NotifyIcon1.Visible = true;
}
private void NotifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{//显示窗体
this.Visible = true;
this.WindowState = FormWindowState.Normal;//当前窗体状态为默认大小
this.NotifyIcon1.Visible = false;
}