所以,这是我的代码:
<Window x:Name="LauncherWindow" x:Class="PlayProjectBilly.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PlayProjectBilly"
mc:Ignorable="d"
Title="Project Billy" Height= "460" BorderThickness="0" Visibility="Visible" WindowStartupLocation="CenterScreen" Icon="Game-Icon.ico" Width="640">
我真的很想知道如何根据用户的屏幕大小调整主窗口的大小,谢谢:)
答案 0 :(得分:0)
将高度和宽度绑定到SystemParameters.PrimaryScreenHeight&amp; SystemParameters.PrimaryScreenWidth分别为。 https://msdn.microsoft.com/en-us/library/system.windows.systemparameters.primaryscreenheight%28v=vs.110%29.aspx