private void MaxSizeBtn_Click(object sender, EventArgs e)
{
if(this.WindowState == FormWindowState.Normal)
{
//最大化窗口不遮盖任务栏
//Screen.FromControl(this)相当于当前屏幕
this.MaximumSize = new Size(Screen.FromControl(this).WorkingArea.Width, Screen.FromControl(this).WorkingArea.Height);
this.WindowState = FormWindowState.Maximized;
}
else
{
this.WindowState = FormWindowState.Normal;
}
}