0

I've been trying to find a way how to change the color of top side marked in blue in this image:

Image 1

I want it to adapt the color of windows. If windows color is blue it should be blue, same for green and other language. Any idea how to do that?

Manfred Radlwimmer
  • 13,257
  • 13
  • 53
  • 62
DezUp
  • 7
  • 7
  • all I'm finding online are how to do the reverse of this. – DezUp Nov 30 '17 at 00:08
  • You could look at [MahApps Metro](https://github.com/MahApps/MahApps.Metro) to see how they do colourised borders. All you need do is query the OS for the colour you need and plug it in –  Nov 30 '17 at 00:53
  • *"same for green and other language"* I'm somehow missing the connection between the color and the language. What do you mean by that? – Manfred Radlwimmer Nov 30 '17 at 07:25
  • seems like the problem with that is not in the code but something I had to activate in windows -_- my bad y'all – DezUp Nov 30 '17 at 23:31

1 Answers1

0

The colour of your title bar should already be adapting to the Windows default. Assuming you are in Windows 10, you can test this by right clicking on your taskbar, going to the "Colors" option in the sidebar and toggling "Show colour on title bar" (note that the colour only shows up when the window is active).

If you're wanting to change the colour of your title bar, this is outside of the client area so you're going to need to do some extra stuff. See this question. To get the system colours, you can use the SystemColors class (more information here). You can also do this within WPF by using:

Property="{DynamicResource {x:Static SystemColors.PropertyName}}"

My advice would be to avoid messing around with this, but if you really want to then there are options.

Lauraducky
  • 674
  • 11
  • 25