从WPF页面应用程序中删除Windows边框/全屏(Remove the windows border/Go fullscreen from a WPF Pages app)

编程入门 行业动态 更新时间:2024-10-22 04:54:00
从WPF页面应用程序中删除Windows边框/全屏(Remove the windows border/Go fullscreen from a WPF Pages app)

我有一个WPF 页面 (不是窗口)应用程序,我希望它没有边框/看到Windows任务栏全屏。 我见过的所有说明都适用于WPF Windows

I have a WPF Pages(not Window) application, and I would like for it to go fullscreen without the border/seeing the windows taskbar. All the instructions i've seen are for WPF Windows.

最满意答案

Pages应用程序旨在在容器内运行。 容器可以是浏览器或您自己的窗口。

由容器来处理全屏操作。

编辑好的,我明白了。 当没有窗口时,框架会为您创建一个窗口。 您可以使用Application.MainWindow访问该窗口,您可以通过这种方式更改属性(vb代码):

Private Sub Application_Activated(sender As Object, e As System.EventArgs) Handles Me.Activated Me.MainWindow.WindowState = WindowState.Maximized Me.MainWindow.WindowStyle = WindowStyle.None End Sub

不过我不建议您继续这种方式,创建一个窗口并在其上放置一个框架,这样您就可以对窗口进行更多控制。

有关WPF Navigation的更多信息,请查看本文http://www.paulstovell.com/wpf-navigation

Pages apps are designed to run inside a container. The container can be the browser or your own window.

It's up to the container to handle the full screen operation.

edit Ok, I get it. When no window is present, the framework creates one for you. You can access the window using Application.MainWindow and you can change the properties this way (vb code):

Private Sub Application_Activated(sender As Object, e As System.EventArgs) Handles Me.Activated Me.MainWindow.WindowState = WindowState.Maximized Me.MainWindow.WindowStyle = WindowStyle.None End Sub

Nevertheless I don't recommend you to continue this way, create a Window and put a frame on it, so you can have more control on the window.

For more info on WPF Navigation check out this article http://www.paulstovell.com/wpf-navigation

更多推荐

本文发布于:2023-07-16 12:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1128583.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:边框   全屏   应用程序   页面   Windows

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!