Wpf 为Windows设置WindowChrome时未显示任务栏
我将系统任务栏设置为自动隐藏,然后以最大化状态运行WPF应用程序。当应用程序处于最大化状态时,我将鼠标悬停在屏幕底部以查看任务栏,但它不会出现。找到下面的代码块Wpf 为Windows设置WindowChrome时未显示任务栏,wpf,windows,wpf-controls,window-chrome,Wpf,Windows,Wpf Controls,Window Chrome,我将系统任务栏设置为自动隐藏,然后以最大化状态运行WPF应用程序。当应用程序处于最大化状态时,我将鼠标悬停在屏幕底部以查看任务栏,但它不会出现。找到下面的代码块 <Window x:Class="_189619.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/200
<Window x:Class="_189619.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:_189619"
mc:Ignorable="d" WindowState="Maximized"
Title="MainWindow" Height="350" Width="525">
<WindowChrome.WindowChrome>
<WindowChrome CaptionHeight="50" ResizeBorderThickness="3"/>
</WindowChrome.WindowChrome>
<Grid>
</Grid>
</Window>
是否有显示任务栏的解决方法
提前谢谢
问候,,
Priyanga B如果您不介意有点复杂的解决方法,我建议您按照中所述处理窗口大小调整,并通过修改
WmGetMinMaxInfo
方法(例如mmi.ptMaxSize.y=Math.Abs(rcWorkArea.bottom-rcWorkArea.top-5);
)为任务栏保留几个像素。注意:如果你需要考虑不同的任务栏方向,可能会有点复杂。谢谢你的回复。我混淆了代码示例。如果可能的话,请分享简单样品。对不起,这个解决方案没有“简单样品”。这有点复杂,但可以让你处理像你这样的边缘案例。