Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 将选定和未聚焦的列表框样式更改为不灰显
我只想将蓝色焦点保持在树视图上并禁用灰色焦点。如何在 WPF 中做到这一点?
为了实现这一点,您需要在 TreeViewItem 的资源中替换System Control Brush,如下所示:
<Style TargetType="TreeViewItem" x:Key="TreeViewItemStyle"> <Style.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Blue>"/> </Style.Resources> </Style>