【问题标题】:How to disable the grey focus on TreeView [duplicate]如何禁用TreeView上的灰色焦点[重复]
【发布时间】:2012-08-06 02:31:12
【问题描述】:

可能重复:
Change selected and unfocused Listbox style to not be grayed out

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

【问题讨论】:

    标签: c# .net wpf treeview


    【解决方案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>
    

    【讨论】:

      猜你喜欢
      • 2010-11-25
      • 2010-11-04
      • 1970-01-01
      • 2018-11-19
      • 1970-01-01
      • 2010-10-16
      • 2018-09-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多