我有ScrollViewer.VerticalScrollBarVisibility =自动一个RichTextBox,这是工作,就像我想它。然而,当我将鼠标悬停我的鼠标在文档上,我得到了整个RichTextBox的元素,我似乎可以让IT部门去如设置IsHitTestVisible =假的必由之路带有蓝色边框,但如果我这样做,滚动条变得太禁用......我已经试过其他的事情是IsFocusable =假,以及为在RichTextBox的风格触发,没有任何成功:禁用/覆盖高亮显示WPF控件
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="{x:Null}"/>
</Trigger>
</Style.Triggers>
我有同样的问题与被显示在ListBox在我的应用程序的图像。我有一个列表框看起来像这样:
<ListBox ItemsSource="{Binding Photos}"
BorderBrush="{x:Null}"
SelectedItem="{Binding SelectedPhoto, Mode=TwoWay}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid IsItemsHost="True"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Columns="3" Rows="1"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Image Source="{Binding}"
Stretch="Uniform"
SnapsToDevicePixels="True"/>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Style.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}"
Color="Transparent"/>
</Style.Resources>
<Setter Property="Foreground" Value="Transparent"/>
<Setter Property="BorderBrush" Value="{StaticResource Brush_Secondary}"/>
<Setter Property="BorderThickness" Value="5"/>
<Setter Property="Margin" Value="5"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="{StaticResource Brush_Primary}"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="BorderBrush" Value="{StaticResource Brush_Selected}"/>
</Trigger>
</Style.Triggers>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
但无论我使用哪种颜色(Brush_Primary /次/选择)的边界始终是蓝色的只是深浅不同的...我如何摆脱这个蓝色覆盖的/高光的事情,似乎对每一个WPF控件存在吗?