我有一个自定义控制模板的水平列表框。当被聚焦时,所选项目会得到一个虚线框。有人知道怎么处理吗?
You need to set FocusVisualStyle of each ListBoxItem to null. Steps are bellow
1) Create ItemContainerStyle for the ListBox
<Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}"> <Setter Property="FocusVisualStyle" Value="{x:Null}"/> ....
2) Set that style to Listbox
<ListBox ItemContainerStyle="{DynamicResource ListBoxItemStyle1}"