Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the window border colour in my UWP App in WinJS

How do I change the window border colour of my app ?

For example, in Microsoft's One Note 2013 app, the purple colour is also on the bar at the top as well as over the minimize, maximize and close buttons.

I am using visual studio 2015.

I have looked in the app manifest and can't seem to find anything

like image 335
thatOneGuy Avatar asked Jan 14 '16 10:01

thatOneGuy


1 Answers

You can set the app title bar color using the ApplicationViewTitleBar class:

var appView = Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
appView.titleBar.backgroundColor = Windows.UI.Colors.black; // or {a: 255, r: 0, g: 0, b: 0}
appView.titleBar.inactiveBackgroundColor = Windows.UI.Colors.black;
appView.titleBar.buttonBackgroundColor = Windows.UI.Colors.black;
appView.titleBar.buttonHoverBackgroundColor = Windows.UI.Colors.black;
appView.titleBar.buttonPressedBackgroundColor = Windows.UI.Colors.black;
appView.titleBar.buttonInactiveBackgroundColor = Windows.UI.Colors.black;
like image 95
niutech Avatar answered Oct 17 '22 05:10

niutech