最大化窗体时,网上找的解决办法要么任务栏遮住了窗体,要么非常非常复杂,实际上就需要一行代码就能解决:
if(thisform.WindowState == WindowState.Normal)
{
thisform.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
thisform.WindowState = WindowState.Maximized;
}
是的,就是其中的:
thisform.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
自我记录一下。