make Listbox items in WPF not selectable

Viewed 50687

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?

11 Answers

You can also handle PreviewMouseDown event

And to prevent tap you can set KeyboardNavigation.TabNavigation="None"

<ListView x:Name="Cards"
            .....
            PreviewMouseDown="CardMonthsDescriptors_OnPreviewMouseDown"
            KeyboardNavigation.TabNavigation="None"
>
...
private void Cards_OnPreviewMouseDown(object sender, MouseButtonEventArgs e)
        {
            e.Handled = true;
        }
Related