[UWP] [C ++]如何仅支持全屏模式:如何删除“窗口化”模式标题栏中的按钮? [英] [UWP][C++]How to support only fullscreen mode: how to remove "windowed" button in title bar?

查看:260
本文介绍了[UWP] [C ++]如何仅支持全屏模式:如何删除“窗口化”模式标题栏中的按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是


我正在开发一款我想作为通用Windows应用程序移植的游戏。我不想处理窗口模式,所以我只希望我的窗口全屏。

我设法使用"ApplicationView :: GetForCurrentView() - >全屏模式启动游戏; PreferredLaunchWindowingMode",但当我将鼠标放在屏幕顶部时,状态栏出现,我点击窗口中的"按钮"。

如何在标题栏中删除此按钮?我想保持"最小化"按钮,但删除"窗口"按钮按钮。
$


我检查了商店里的几个应用程序,有些设法做了,比如"Jetpack Joyride"。他们还设法阻止他们以平板电脑模式捕捉他们的应用程序(当您在屏幕的一半上捕捉应用程序时)。我该怎么办?

$
谢谢你
Yannick

Hi,

I'm working on a game I would like to port as an Universal Windows App. I don't want to deal with a windowed mode, so I would like my window only in fullscreen.
I managed to start my game in fullscreen mode using "ApplicationView::GetForCurrentView()->PreferredLaunchWindowingMode", but when I put my mouse on the top of the screen, the status bar appears and I click on the windowed "button".
How can I remove this button in my title bar? I would like to keep the "minimize" button, but remove the "windowed" button.

I checked several apps on the store, and some managed to do it, like "Jetpack Joyride". They also managed to prevent from snapping their app in tablet mode (when you snap an app on one half of the screen). How can I do it?

Thanks
Yannick

推荐答案

嗨saladgamer,

Hi saladgamer,

欢迎来到开发通用Windows应用程序
论坛!

请阅读粘性帖子,特别是
发布指南:主题行标记

Windows 10 SDK和工具的已知问题

Please read the sticky posts, especially the Guide to posting: subject line tags and Known Issues for Windows 10 SDK and Tools

>> 如何删除"窗口""标题栏中的按钮?

无法在UWP窗口中删除TitleBar上的那些按钮。但是我们可以通过设置AppView的TitleBar的Button * BackgroundColor属性来自定义UWP中标题栏的外观,如下所示:

It is not possible to remove those button on the TitleBar in UWP windows. But we can customize the appearance of the title bar in a UWP by setting the Button*BackgroundColor properties of the TitleBar of the AppView like this:

            var appView = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();
            var titleBar = appView.TitleBar;
            titleBar.BackgroundColor = Windows.UI.Colors.Red;
            titleBar.ButtonBackgroundColor = Windows.UI.Colors.Red;
            titleBar.ButtonForegroundColor = Windows.UI.Colors.Red;
            titleBar.ButtonBackgroundColor = Windows.UI.Colors.Red;
            titleBar.ButtonHoverForegroundColor = Windows.UI.Colors.Red;
            titleBar.ButtonHoverBackgroundColor = Windows.UI.Colors.Red;
            titleBar.ButtonPressedForegroundColor = Windows.UI.Colors.Red;
            titleBar.ButtonPressedForegroundColor = Windows.UI.Colors.Red;
            titleBar.ButtonInactiveBackgroundColor = Windows.UI.Colors.Red;
            titleBar.ButtonInactiveForegroundColor = Windows.UI.Colors.Red;

如果 我们对所有属性使用相同的颜色 我们将有效地隐藏按钮。

If we use the same colour for all properties we will effectively hide the buttons.

有关详细信息,请尝试参考以下类似的主题:

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/4e43fe2a-15b2-46a9-9983-11666a210603/uwpc-is-it-posible-to-hide-control-box-minimizemaximizeclose -buttons-in-uwp-window?forum = wpdevelop

For more information, please try to refer to the following similar thread:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/4e43fe2a-15b2-46a9-9983-11666a210603/uwpc-is-it-posible-to-hide-control-box-minimizemaximizeclose-buttons-in-uwp-window?forum=wpdevelop .

最好的问候,

Amy Peng

Best Regards,
Amy Peng


这篇关于[UWP] [C ++]如何仅支持全屏模式:如何删除“窗口化”模式标题栏中的按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆