当窗体风格为none时,窗体排布

http://blogs.msdn.com/llobo/archive/2008/02/07/maximizing-borderless-window-using-sysparameter-values.aspx

Earlier on, I had written a post on maximizing a borderless (WindowStyle=None) window but without covering the taskbar. This solution works well but was not that nice to look at implementation wise :) ... However, theres a simplere solution to achieve the same. I get quite a few queries about the previous post, so I thought it would be a good idea to post this simple solution..

 <Window

      Width="{DynamicResource {x:Static SystemParameters.MaximizedPrimaryScreenWidthKey}}"

      Height="{DynamicResource {x:Static SystemParameters.MaximizedPrimaryScreenHeightKey}}"

      WindowStartupLocation="CenterScreen"

      WindowStyle="None"/>

SystemParameters to the rescue... for the code behind version,

win.Height = SystemParameters.MaximizedPrimaryScreenHeight;

win.Width = SystemParameters.MaximizedPrimaryScreenWidth;

win.Top = 0;win.Left = 0;

原文地址:https://www.cnblogs.com/ningth/p/1151333.html