Search code examples
visual-studiowin-universal-appwinjswindows

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


Solution

  • 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;