重写窗体的OnClosing事件 protected override void OnClosing(CancelEventArgs e) { this.WindowState = FormWindowState.Minimized; e.Cancel = true; }