【发布时间】:2012-08-06 02:31:12
【问题描述】:
可能重复:
Change selected and unfocused Listbox style to not be grayed out
我只想将蓝色焦点保留在树视图上并禁用灰色焦点。在 WPF 中如何做到这一点?
【问题讨论】:
可能重复:
Change selected and unfocused Listbox style to not be grayed out
我只想将蓝色焦点保留在树视图上并禁用灰色焦点。在 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>
【讨论】: