Hi,@Juan Dent . Welcome Microsoft Q&A.
To modify the background color of the ComboBox as needed, it is necessary to modify the ControlTemplate of the ComboBox .
You could refer to the following code to modify and use the default template of Combobox.
Get the default template of Combobox in xaml.
Style:
Find and modify the value of ComboBox.Static.Background in the newly created resource.
<SolidColorBrush x:Key="ComboBox.Static.Background" Color="LightCyan"/>
Add the following code in the ControlTemplate.Triggers of the ComboBoxToggleButton style.
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsDropDownOpen, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true"/>
</MultiDataTrigger.Conditions>
<Setter Property="Background" TargetName="templateRoot" Value="red"/>
<Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ComboBox.MouseOver.Editable.Border}"/>
<Setter Property="Background" TargetName="splitBorder" Value="red"/>
<Setter Property="BorderBrush" TargetName="splitBorder" Value="{StaticResource ComboBox.MouseOver.Editable.Button.Border}"/>
</MultiDataTrigger>
The complete code:
229015-5.txt
The result:
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.