WPF: Remove dotted border around focused item in styled listbox

WpfXamlListboxFocusBorder

Wpf Problem Overview


I have a horizontal listbox with a custom controlIemplate. The selected item gets a dotted frame when focused. Anyone know how to get rid of it?

Wpf Solutions


Solution 1 - Wpf

You need to set FocusVisualStyle of each ListBoxItem to null. Steps are bellow

  1. Create ItemContainerStyle for the ListBox

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionVegarView Question on Stackoverflow
Solution 1 - WpfJobi JoyView Answer on Stackoverflow