02
2012
04

窗体关闭却是最小化

private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
this.WindowState = FormWindowState.Minimized;
}
01
2012
04

C#编写最小化时隐藏为任务栏图标的Window

C#编写最小化时隐藏为任务栏图标的Window appllication.
1.设置窗体属性showinTask=false

2.加notifyicon控件notifyIcon1,为控件notifyIcon1的属性Icon添加一个icon图标。

3.添加窗体最小化事件(首先需要添加事件引用):

// this.SizeChanged += new System.EventHandler(this.Form1_SizeChanged);
...
«1»