WPF 中的全屏窗口
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28489398/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Full Screen Window in WPF
提问by pxjcode
I am developing an application in c# using WPF. I am using
我正在使用 WPF 在 c# 中开发应用程序。我在用
Height="768" Width="1366" Loaded="WindowLoaded"
WindowStyle="ToolWindow" WindowState="Maximized"
parameters. Now to create full screen I change the WindowStyle to None. This does make it full screen but the close button disappears. Also the full screen doesn't cover the taskbar. Any suggestions?
参数。现在要创建全屏,我将 WindowStyle 更改为 None。这确实使它全屏,但关闭按钮消失了。此外,全屏不覆盖任务栏。有什么建议?
回答by Ric .Net
With WPF you almost never must define Widthand Heightproperties. WPF will render your screens much better by using relative sizes. So if you want a full screen ToolWindowwhich covers the taskbar use:
使用 WPF,您几乎不需要定义Width和Height属性。WPF 将通过使用相对大小更好地呈现您的屏幕。因此,如果您想要一个ToolWindow覆盖任务栏的全屏,请使用:
WindowStyle="ToolWindow" ResizeMode="NoResize" WindowState="Maximized"
in your xaml.
在你的 xaml 中。

