WPF窗体常用属性(一):NonActiveWindowTitleBrush

NonActiveWindowTitleBrush属性可以设置WPF窗体在失去焦点后的标题栏颜色,一般默认设置为"Gray",但可在xaml文件中进行修改,改为其他颜色,如:

 

<Window x:Class="Acrophone.MainWindow"

                      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

                      BorderBrush="{DynamicResourceAccentColorBrush}" BorderThickness="1"

                      Height="500" Width="350" MinHeight="500" MinWidth="350"                      WindowStartupLocation="CenterScreen"

                      TitlebarHeight="40"

                      NonActiveWindowTitleBrush=" Red">

 

设置NonActiveWindowTitleBrush="Red",窗体失去焦点后会变为红色。

扫描二维码关注公众号,回复: 2356488 查看本文章

猜你喜欢

转载自blog.csdn.net/wzh0316/article/details/79746921