C# wpf - c-sharpcorner.com/forums/how-do-highlight-one-listbox-item.
When I highlight one ListBox item
C#
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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Abhishek YadavRank #217 · 11.3K reputationPosted Mar 13, 2024, 2:43 AM EDT
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.