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",窗体失去焦点后会变为红色。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章