WPF: Supprimer la bordure en pointillés autour de l'article focalisée dans listbox Styled

StackOverflow https://stackoverflow.com/questions/592665

Question

J'ai un listbox horizontal avec un controlIemplate personnalisé. L'élément sélectionné devient un cadre en pointillés lorsqu'elle se concentre. Quelqu'un sait comment se débarrasser de lui?

Était-ce utile?

La solution

Vous devez définir FocusVisualStyle de chaque ListBoxItem à null. Les étapes sont ci-dessous

1) Créer ItemContainerStyle pour la zone de liste

<Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}"> 
   <Setter Property="FocusVisualStyle" Value="{x:Null}"/> ....

2) Définir ce style à Listbox

<ListBox ItemContainerStyle="{DynamicResource ListBoxItemStyle1}"
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top