C#的问题,关于托盘的
来源:百度知道 编辑:UC知道 时间:2024/06/23 05:04:46
还要加一条:
this.WindowState = FormWindowState.Normal;
还要WindowState属性设置为Normal或者Maximized
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.ShowInTaskbar = true; //显示在系统任务栏
this.WindowState = FormWindowState.Normal; //还原窗体
notifyIcon1.Visible = false; //托盘图标隐藏
}
}
private void 还原窗口ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.ShowInTaskbar = true; //显示在系统任务栏
this.WindowState = FormWindowState.Normal; //还原窗体
notifyIcon1.Visible = false; //托盘图标隐藏
}
}
private void 退出ToolStripMenuItem_Click(object sender, Ev