Window clicked the close button and just hide then click it will show

 1  this.FormClosing += AFormClosing;
 2 
 3 
 4 private void AFormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
 5         {
 6             if (e.CloseReason == CloseReason.UserClosing)
 7             {
 8                 e.Cancel = true;
 9                 Hide();
10             }
11         }

 When you want to see the hide form.

newForm.Show();

newForm.Visible=true;

posted @ 2020-10-21 15:32  FredGrit  阅读(83)  评论(0编辑  收藏  举报