如何将窗口的MaxHeight属性设置为屏幕高度?
XAML:
<Window x:Class="RT.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="{Binding WindowTitle}" Height="300" MaxHeight="500" Width="495.149" SizeToContent="WidthAndHeight">
Run Code Online (Sandbox Code Playgroud)
在控件的代码隐藏页面中,您可以将MaxHeight窗口设置为
System.Windows.SystemParameters.PrimaryScreenHeight
Run Code Online (Sandbox Code Playgroud)
或者你可以使用 SystemParameters.VirtualScreenHeight
| 归档时间: |
|
| 查看次数: |
3781 次 |
| 最近记录: |