wpf树形图控件问题

纵横车 2018-04-10 07:28:35

如图当鼠标移动或点击到一个条目上时,会出现白色的框,求怎么去掉?

下面是树形图的axml,几乎只设置了背景颜色
<UserControl x:Class="WpfContrl.WpfTreeView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:cal="http://www.caliburnproject.org"
xmlns:model="clr-namespace:WpfContrl"
mc:Ignorable="d"
d:DesignHeight="414" d:DesignWidth="461">

<UserControl.Resources>



</UserControl.Resources>

<!--DataType="{x:Type model:DepartmentModel}" Style="{DynamicResource TreeViewStyle1}" -->
<DockPanel Name="DockPanel1" LastChildFill="True">
<TreeView Margin="0,0,0,0" Name="treeView1" Background="#34373E" TreeViewItem.Selected="tvListDataTable_Selected">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Nodes, IsAsync=True}">
<StackPanel Orientation="Horizontal" Background="Red">
<Image VerticalAlignment="Center" Source="{Binding Path=Icon}" Width="16" Height="16" Margin="0,0,2,2"></Image>
<TextBlock VerticalAlignment="Center" FontSize="14" Text="{Binding Path=deptName}" Margin="2,0,0,0" ></TextBlock>
</StackPanel>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
</DockPanel>
</UserControl>



尝试设置过<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="LightBlue" Opacity=".0"/>属性,
也加过Triggers,在鼠标移进的时候手动设置背景色。也没有用

另,这种白框只在windows server2012 r2上测试出现,win7,win10均为出现。
...全文
797 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复

17,741

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 .NET Framework
社区管理员
  • .NET Framework社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧