Answer the question
In order to leave comments, you need to log in
Trigger doesn't change color on hover?
<Window.Resources>
<Style TargetType="Button">
<Setter Property="Foreground" Value="#fff"/>
<Setter Property="Background" Value="#FF0F4FC5"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#FF00091B" />
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Window.Resources>
<Button Content="Test" Height="100" Margin="18,125,51,138" />
Answer the question
In order to leave comments, you need to log in
Everything looks right. In addition, the style does not have an identifier, and the button does not have a style set. Is it the same in the code or just here in the example?
<Style x:Key="MyStyle" TargetType="Button">
...
<Button Content="Test" Height="100" Margin="18,125,51,138" Style="{StaticResource MyStyle}" />
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question