问题
I'm working on a Universal Windows Platform-application for desktop platforms. How can I disable/remove the maximise-button from a <page>
or <application>
in Windows 10?
回答1:
You cannot. I didn't see any option to disable these buttons. You can only change their colors.
ApplicationViewTitleBar titlebar = ApplicationView.GetForCurrentView().TitleBar;
titlebar.ButtonBackgroundColor = Windows.UI.Color.FromArgb(255, 126, 188, 66);
titlebar.ButtonForegroundColor = Windows.UI.Colors.White;
回答2:
If the objective of removing the Maximize/Minimize button is to run the app in Kiosk mode then you can see something like https://technet.microsoft.com/itpro/windows/manage/set-up-a-kiosk-for-windows-10-for-desktop-editions
However, you cannot remove these things programatically
回答3:
There could be another workaround for this : Although you cannot disable the AppTitle bar but you can try entering your view to full view so that it covers up the Title bar and then you can add a custom title bar if you need to customize the functionality.
https://social.msdn.microsoft.com/Forums/windowsapps/en-US/830607c5-0b2a-4309-b59c-ab4b381cf128/what-is-the-easiest-way-to-show-full-screen-button-in-the-app-title-bar?forum=wpdevelop#9b3d0f1a-dfa9-4949-8785-80a74e911790
回答4:
We can hide the maximize and minimize buttons by the ResizeMode property in our .xaml like this
ResizeMode="NoResize" //CanMinimize || CanResize || CanResizeWithGrip
Resize mode will allow any of the four values for the Window element in the form.
来源:https://stackoverflow.com/questions/34271591/disable-fullscreen-maximise-button-in-uwp-application