I have a listbox in WPF, and when they select an item, it shows an ugly colors Can I make all the items non-selectable?
Add Focusable property as false in ListBoxItem style:
<Style x:Key="{x:Type ListBoxItem}" TargetType="{x:Type ListBoxItem}"> <!-- Possibly other setters --> <Setter Property="Focusable" Value="False" /> </Style>
If you don't need selection, use an ItemsControl
rather than a ListBox
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With