0
votes

I have created a simple WPF form and added a listbox with some items on it. By default when i run the application on Windows 10 the mouseover effect is blue (the listitems background color changes) and for the selected item the same.

How can i change this color for mousover and selected item to lets say red ?

1

1 Answers

0
votes

You can change the styles of Listbox directly (which Ayyappann's comment refers to). Another way you can change the highlight color, if you would like it to be global, is to change the system colors. So in your App.xaml you could put something like this:

<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Red" />

I prefer this way if i want certain actions to stay consistent (mouse over any object), OR if i would like to allow styles to be changed dynamically. I will customize the individual styles of local objects if i am looking for that object to have a typical behavior. A list of the system colors can be found Here