如何禁用灰色重点的TreeView

问题描述:

可能重复:
Change selected and unfocused Listbox style to not be grayed out如何禁用灰色重点的TreeView

我只希望保持对树视图中的蓝色对焦和禁用灰色对焦。这怎么能在WPF中完成?

为了实现这一点,你需要更换系统控制刷像TreeViewItem的资源如下:

<Style TargetType="TreeViewItem" x:Key="TreeViewItemStyle"> 
    <Style.Resources> 
     <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Blue>"/> 
    </Style.Resources> 
    </Style>