Home » FAQ » WPF » ListBox » Why does the selection stay grayed out after I change the selection in the ListBox in the click of a button?
This is because the ListBox still doesn’t have the focus. To force focus on the listbox, call it’s Focus method after changing selection on it as follows:
this.myListBox.Focus();
Platform BlazorASP.NETWinFormsWPF.NET MAUI
Question *
Answer (Optional)
Email (Optional)
Email address is only for further clarification on your FAQ request. It will not be used for any other purpose.
Please leave this field empty.
Share with