WPF: Remove dotted border around focused item in styled listbox

后端 未结 1 907
名媛妹妹
名媛妹妹 2020-11-30 22:39

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?

1条回答
  •  醉话见心
    2020-11-30 23:35

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

    1) Create ItemContainerStyle for the ListBox