I'm creating a WPF application where several ListView selections are made in a row (similar to the iTunes browser). The problem is that the default inactive selection color is too light. (see below)
How can I change this color so my inactive listview looks like this? (see below)
Solution
使用 a 覆盖默认的 SystemColorStyle
像这样:
<Style TargetType="ListViewItem">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="{x:Static SystemColors.HighlightColor}"/>
</Style.Resources>
</Style>
改变SystemColors.ControlBrushKey
不适合我,我必须改变SystemColors.InactiveSelectionHighlightBrushKey
所以而不是:
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Red" />
我不得不使用:
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="Red"/>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)