wpf icon indicating copy to clipboard operation
wpf copied to clipboard

Button hilite color

Open TKoodi opened this issue 2 months ago • 0 comments

Window 11 fluent theme.

When trying to define custom hi-lite color for button in old way:

                <Button.Style>
                    <Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}">
                        <Setter Property="Background" Value="Red"/>
                        <Style.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="Background" Value="Lime"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                </Button.Style>

It's does not work. I also trying to set new styles:

              <Button.Resources>
                   <SolidColorBrush x:Key="ButtonPointerOverBackgroundBrush" Color="Red"/>
                   <SolidColorBrush x:Key="ButtonPressedBackgroundBrush" Color="DarkRed"/>
               </Button.Resources>

But it does not seems work neither.

TKoodi avatar Oct 19 '25 19:10 TKoodi