0
<Style TargetType="ListBoxItem">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="Transparent" />
</Style.Resources>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="White" />
</Trigger>
</Style.Triggers>
</Style>
上述代码旨在防止任何高亮颜色用作我的列表框项目的“选择指示符”。我的程序有一个完全白色的背景,我打算使用一些自定义动画来代替选择。上面的代码确实删除了传统的蓝色突出显示,但它也使文本(在项目容器内)完全消失,所以我看到的只是一个白色项目。将列表框高亮颜色设置为空
任何想法?
干杯!这工作完美。 – randomalbumtitle 2012-02-17 04:34:56