I have several years of software development but I am brand new to WPF. I just started working with a new company that uses WPF. I am learning it on the job.
I have been looking all over for a solution to this problem. I have seen a couple of solutions but when I tried them they never worked. One solution I found here was this
<ComboBox.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#FFE89519" />
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey }" Color="#FFE89519" />
</ComboBox.Resources>
This did not work. In the comments of one of the answers with this solution the person said it does not work in Windows 8. Don't ya just love consistency. Apparently this is also true of Window 11.
Another solution said to create a MultiTrigger like this
<ComboBoxItem>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True"/>
<Condition Property="IsMouseOver" Value="False"/>
<Condition Property="IsKeyboardFocused" Value="False"/>
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="MyComboBox" Value="#D1E8FF"/>
<Setter Property="BorderBrush" TargetName="MyComboBox" Value="#66A7E8"/>
</MultiTrigger>
</ComboBoxItem>
But this just generated errors in my code. It did not know how to deal with IsSelected, IsMouseOver or IsKeyboardFocused. I found that odd seeing that they are listed as properties of the ComboBox on Microsoft web site.
Does anyone have any other solutions that work in 2022 and not just 2002?
All I want to do is change the color of the highlight bar when using the Up and Down arrow keys on the ComboBox dropdown list.