C#winform如何主窗口最大化最小化默认大小

时间:2024-01-26 14:53:13

 

 

1             this.WindowState = FormWindowState.Minimized;
 1          bool b = true;
 2         private void button2_Click(object sender, EventArgs e)
 3         {
 4            
 5             if (b)
 6             {
 7                 this.WindowState = FormWindowState.Maximized;
 8                 b = false;
 9             }
10             else
11             {
12                 this.WindowState = FormWindowState.Normal;
13                 b = true;
14             }
15         }