大佬教程收集整理的这篇文章主要介绍了c# – 禁用/覆盖WPF控件上的突出显示,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
<Style.triggers> <trigger Property="IsMouSEOver" Value="True"> <Setter Property="BorderBrush" Value="{x:Null}"/> </trigger> </Style.triggers>
我的应用程序中的图像与ListBox中显示的问题相同.我有一个ListBox看起来像这样:
<ListBox Items@R_450_9016@e="{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 @R_450_9016@e="{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 / Secondary / SELEcted),边框总是只有不同的蓝色阴影……如何摆脱每个WPF控件似乎存在的蓝色叠加/突出显示?
@H_696_2@
<Style TargetType="RichTextBox"> <Setter Property="Template"> <Setter.Value> <ControlTemplate> <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True" BACkground="{TemplateBinding BACkgrounD}"> <ScrollViewer Name="PART_ContentHost"/> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style>@H_696_2@ @H_696_2@
以上是大佬教程为你收集整理的c# – 禁用/覆盖WPF控件上的突出显示全部内容,希望文章能够帮你解决c# – 禁用/覆盖WPF控件上的突出显示所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。