簡體   English   中英

您將如何根據WPF應用程序中的屏幕尺寸來調整主窗口的大小

[英]How would you be able to resize the main window depending on the screen size in a WPF Application

所以,這是我的代碼:

<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">

我真的很想知道您如何根據用戶屏幕尺寸來調整主窗口的大小,謝謝:)

將高度和寬度分別綁定到SystemParameters.PrimaryScreenHeight和SystemParameters.PrimaryScreenWidth。 https://msdn.microsoft.com/zh-cn/library/system.windows.systemparameters.primaryscreenheight%28v=vs.110%29.aspx

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM