gpt4 book ai didi

WPF : Maximize window with WindowState Problem (application will hide windows taskbar)

转载 作者:行者123 更新时间:2023-12-02 20:08:18 24 4
gpt4 key购买 nike

我已将主窗口状态设置为“最大化”,但问题是我的应用程序将填满整个屏幕,甚至任务栏。我究竟做错了什么 ?我使用的是 Windows 2008 R2,分辨率为:1600 * 900

这是 Xaml:

<Window x:Class="RadinFarazJamAutomationSystem.wndMain"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:RadinFarazJamAutomationSystem"
xmlns:mwt="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
Title="MyName" FontFamily="Tahoma" FontSize="12" Name="mainWindow" WindowState="Maximized" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
xmlns:my="clr-namespace:RadinFarazJamAutomationSystem.Calendare.UC" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Loaded="mainWindow_Loaded" FlowDirection="LeftToRight"
ResizeMode="NoResize" Closed="mainWindow_Closed">

最佳答案

您可以使用构造函数将该窗口的 MaxHeight 属性设置为 SystemParameters.MaximizedPrimaryScreenHeight

public MainWindow()
{
InitializeComponent();
this.MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
}

关于WPF : Maximize window with WindowState Problem (application will hide windows taskbar),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6890472/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com