1private void ShowHideWindow(bool isShow)
2{
3 if(isShow)
4 {
5 if(this.ShowInTaskbar==false)
6 {
7 this.ShowInTaskbar = true;
8 this.Show();
9 this.WindowState = FormWindowState.Normal;
10 }
11 else
12 {
13 if(this.WindowState == FormWindowState.Minimized)
14 {
15 this.WindowState = FormWindowState.Normal;
16 }
17 }
18 this.Activate();
19 }
20 else
21 {
22 if(this.ShowInTaskbar == true)
23 {
24 this.Hide();
25 this.ShowInTaskbar = false;
26 }
27 }
28}
29
30
2{
3 if(isShow)
4 {
5 if(this.ShowInTaskbar==false)
6 {
7 this.ShowInTaskbar = true;
8 this.Show();
9 this.WindowState = FormWindowState.Normal;
10 }
11 else
12 {
13 if(this.WindowState == FormWindowState.Minimized)
14 {
15 this.WindowState = FormWindowState.Normal;
16 }
17 }
18 this.Activate();
19 }
20 else
21 {
22 if(this.ShowInTaskbar == true)
23 {
24 this.Hide();
25 this.ShowInTaskbar = false;
26 }
27 }
28}
29
30
本文摘自 :https://blog.51cto.com/u