Windows 10 Title Bars

FercKast

New member
Jan 24, 2015
3
0
0
Hi, I was just trying out VS Community 2015 to do a small side-project and couldn't find where to set the title bar color for either the new "universal" apps or legacy Windows "forms" programs when they run on Windows 10. I tried a few suggestions from google search, but the title bar color was still grey. Seeing as both the desktop & mobile version of Office 2016 can do this, I know it is possible. I'm just wondering what property I'm overlooking or setting that I may not have turned on.
 
If you are developing a Windows 10 universal app in C#, you can change title bar settings by using this code in your code-behind file (xxx.cs):
var titlebar = ApplictionView.GetForCurrentView().Titlebar; titlebar.BackgroundColor = Colors.Black //Sets title bar background to black titlebar.ForegroundColor = Colors.White //Sets title bar title to white titlebar.ButtonBackgroundColor = Colors.Black; //Sets title bar button's background to black titlebar.ButtonForegroundColor = Colors.White; //Sets title bar button's foreground color to white.


There are also other variables for hover background and pressed and disabled. You can also use the space in the titlebar for conent by using this code:

CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true;


Source: https://marcominerva.wordpress.com/2015/05/19/easily-manage-the-title-bar-in-windows-10-apps/
 

Members online

Forum statistics

Threads
335,441
Messages
2,258,442
Members
428,731
Latest member
KennyA