C#怎样才能实现窗体最小化到托盘呢?
时间:2021-05-18 09:42:47|栏目:.NET代码|点击: 次
private void Form1_Resize(object sender, System.EventArgs e) {
if (this.WindowState == FormWindowState.Minimized) {
this.Visible = false;
this.notifyIcon1.Visible = true;
}
}
private void notifyIcon1_Click(object sender, System.EventArgs e) {
this.Visible = true;
this.WindowState = FormWindowState.Normal;
this.notifyIcon1.Visible = false;
}
if (this.WindowState == FormWindowState.Minimized) {
this.Visible = false;
this.notifyIcon1.Visible = true;
}
}
private void notifyIcon1_Click(object sender, System.EventArgs e) {
this.Visible = true;
this.WindowState = FormWindowState.Normal;
this.notifyIcon1.Visible = false;
}
栏 目:.NET代码
下一篇:ASP.net(c#)用类的思想实现插入数据到ACCESS例子
本文标题:C#怎样才能实现窗体最小化到托盘呢?
本文地址:http://www.codeinn.net/misctech/123629.html






