在我的 Windows 窗体应用程序(C#)中,我有这样的代码:
private void frm_main_Resize(object sender, EventArgs e)
{
if ((this.WindowState == FormWindowState.Minimized) && (checkBox1.Checked))
{
this.ShowInTaskbar = false;
notifyIcon1.Visible = true;
}
}
private void notifyIcon1_DoubleClick(object Sender, EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.WindowState = FormWindowState.Normal;
}
else
{
this.WindowState = FormWindowState.Minimized;
}
this.Activate();
}
我的 publick 表单有双击处理程序 notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick);
当最小化的应用程序仍然出现在任务栏中时,如何更改?我希望在最小化状态下它只会在系统托盘中。为什么这个 coce deosnt 工作?