This one took me a while to figure out, so I thought I’d share it with everyone. If you have a treeview item and don’t want the selected item to be that ugly blue color, you can easily change it.
All you need to do is add this line of code into your Treeview. In this particular example, I didn’t want the selected item to be colored at all, so I set the color to Transparent, but you can enter other colors here to suit your app’s needs.
Hope this helps. Happy coding!
<TreeView.Resources>
<SolidColorBrush Color="Transparent" x:Key="{x:Static SystemColors.HighlightBrushKey}"/>
</TreeView.Resources>
del.icio.us Tags: wpf,treeview item,treeeview,treeview item style,background,selected item background,ui
awesome, quick fix! Gonna test it out.
ReplyDeleteThat's working, and it's great! Thank you! (Ofer)
Delete