private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e) { this.WindowState = FormWindowState.Normal; //若使用Hide()时,要用Show()方法显示窗体 } private void MainForm_Resize(object sender, EventArgs e) { this.ShowInTaskbar = this.WindowState != FormWindowState.Minimized;//最小化时不在任务栏显示 //或者如下 if (this.WindowState == FormWindowState.Minimized) Hide();//最小时隐藏 }
时间: 2024-10-29 12:19:39