Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changing WPF title bar background color

Tags:

titlebar

wpf

I have a WPF Windows application. I need to change the background color of the title bar. How can I do that?

like image 407
Emad Gabriel Avatar asked Aug 15 '09 22:08

Emad Gabriel


People also ask

How do I change the color of the title bar in WPF?

<Button x:Name="MaximizeButton" Style="{StaticResource MaximizeButtonStyle}" /> </Grid> <Button x:Name="CloseButton" Background="Red" Style="{StaticResource CloseButtonStyle}" /> </StackPanel>

How do I change the title bar in WPF?

In WPF the titlebar is part of the non-client area, which can't be modified through the WPF window class. You need to manipulate the Win32 handles (if I remember correctly). – Lyle S. @LyleS.

How do I change the background color in WPF?

Navigate to the Properties window, and click the Background drop-down arrow, and choose Red or another color in the color picker.


1 Answers

In WPF the titlebar is part of the non-client area, which can't be modified through the WPF window class. You need to manipulate the Win32 handles (if I remember correctly).
This article could be helpful for you: Custom Window Chrome

like image 182
Marcel B Avatar answered Oct 15 '22 07:10

Marcel B