C# 全屏wpf

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15920067/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-10 18:27:19  来源:igfitidea点击:

full screen wpf

c#wpfxamlfullscreen

提问by Lamloumi Afif

I am developing a WPF application which will be displayed in Full screen. In addition, the application should work on many tablets of multiple dimensions. I'd like my application to run in full screen independently from its dimensions.

我正在开发一个 WPF 应用程序,它将以全屏显示。此外,该应用程序应适用于多个维度的平板电脑。我希望我的应用程序独立于其尺寸以全屏方式运行。

What is the best practice to accomplish this task?

完成此任务的最佳实践是什么?

采纳答案by Thomas Levesque

Just set the WindowStateto Maximized, and the WindowStyleto None.

只需设置WindowStatetoMaximizedWindowStyleto None

回答by Kurt Van den Branden

Set the WindowStyle to None, and the WindowState to Maximized. This can be done like this:

将 WindowStyle 设置为 None,将 WindowState 设置为 Maximized。这可以像这样完成:

WindowState = WindowState.Maximized;
WindowStyle = WindowStyle.None;

Or in xaml:

或在 xaml 中:

<Window x:Class="FullScreenApplication.Window"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Full Screen WPF"
    WindowState="Maximized"
    WindowStyle="None">

And simply click ALT-TAB to escape from your full screen wpf. It allows you to switch between other applications.

只需单击 ALT-TAB 即可退出全屏 wpf。它允许您在其他应用程序之间切换。