C#窗体最小化到状态栏
C# 窗体最小化到状态栏 双击正常显示窗体 (contextMenustrip 设置右键菜单)
首先在窗体中添加一个 notifyIcon1控件
[csharp]
//最小化时
private void Form1_SizeChanged(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.notifyIcon1.Visible = true;
this.Visible = false;
}
}
[csharp]
//鼠标双击任务栏图标显示程序界面:
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (this.Visible == false)
this.Visible = true;
}
摘自 欧阳小燕
补充:软件开发 , C# ,