0

可能重复:
将选定和未聚焦的列表框样式更改为不灰显

我只想将蓝色焦点保持在树视图上并禁用灰色焦点。如何在 WPF 中做到这一点?

4

1 回答 1

1

为了实现这一点,您需要在 TreeViewItem 的资源中替换System Control Brush,如下所示:

   <Style TargetType="TreeViewItem" x:Key="TreeViewItemStyle">
    <Style.Resources>
        <SolidColorBrush  x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Blue>"/>
    </Style.Resources>
   </Style>
于 2012-08-06T03:16:39.913 回答