C# wpf - c-sharpcorner.com/forums/how-do-highlight-one-listbox-item.
When I highlight one ListBox item
gLBxEpidemicSequence.SelectedIndex = iIndex;
The background is Gray. How do I change the background color?
C# wpf - c-sharpcorner.com/forums/how-do-highlight-one-listbox-item.
When I highlight one ListBox item
gLBxEpidemicSequence.SelectedIndex = iIndex;
The background is Gray. How do I change the background color?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Abhishek YadavPosted Mar 13, 2024, 6:43 AM
You can change the background color of the selected ListBox item by setting the SelectionBackground property of the ListBox control.
For example, if you want to change the background color to blue, you can do the following:
This will change the background color of the selected item to blue. You can replace Brushes.Blue with any other color or brush that you want to use.