1

I am trying to change the button's background color when the mouse is hovering the button, however, it does not seems to work.

My Style:

  <Window.Resources>
    <Style TargetType="Button" x:Key = "GAButtonDark">
        <Setter Property="Background" Value="#1E1F1F"/>
        <Setter Property="Foreground" Value="#9E9F9F"/>
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="Black"/>
            </Trigger>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Foreground" Value="#70E1E5"/>
            </Trigger>
        </Style.Triggers>
    </Style>
</Window.Resources>

My Button

<Button Style ="{StaticResource GAButtonDark}"  Content="Button" HorizontalAlignment="Left" VerticalAlignment="Top" Width="95" Margin="125,45,0,0" Height="35"/>

0 Answers0