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",窗體失去焦點後會變爲紅色。


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