Unable to create WPF ComboBox for mouse

Does anyone know how to style the WPF ComboBox background property when the mouse hangs over it?

enter image description here

I can not get rid of the blue-ish button, similar to the background with ComboBox.

+4
source share
2 answers

You can style it like anything else:

<Style TargetType="{x:Type ComboBox}" x:Key="HoverBox"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background" Value="Blue" /> </Trigger> </Style.Triggers> </Style> 

using:

 <ComboBox Style="{StaticResource HoverBox}" ... /> 

And at the top of your UserControl / Window you should put a style:

 <UserControl...> <UserControl.Resources> <Style TargetType="{x:Type ComboBox}" x:Key="HoverBox"> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background" Value="Blue" /> </Trigger> </Style.Triggers> </Style> </UserControl.Resources> [CONTENT HERE] </UserControl> 
+4
source

Source: https://habr.com/ru/post/1346880/


All Articles