Click here to Skip to main content
15,921,169 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone, can someone help me with wpf button
I want to remove the border and button glow effect.
my button has an image background, it changes when the mouse hover but the button glows.

here is the button code, I'm using visual studio 2010

XML
<Button  Grid.Row="1" Height="214" HorizontalAlignment="Left" Margin="92,10,0,0" Name="Inv" VerticalAlignment="Top" Width="279" BorderBrush="{x:Null}" Foreground="{x:Null}" Click="Inv_Click" Grid.RowSpan="2" BorderThickness="0" ClickMode="Press" Focusable="False" >
            <Button.Style>
                <Style TargetType="{x:Type Button}">
                    <Setter Property="Background">
                        <Setter.Value>
                            <ImageBrush ImageSource="/ManaData;component/Images/Inv.png"/>
                        </Setter.Value>
                    </Setter>
                    <Style.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Background">
                                <Setter.Value>
                                    <ImageBrush ImageSource="/ManaData;component/Images/Inv2.png"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </Button.Style>
        </Button>
Posted

1 solution

you can simply override the default border brush to your own border brush

XML
<style.triggers>
    <trigger property="IsMouseOver" value="true">
        <setter property="BorderBrush" value="{StaticResource ToYourBorder}"></setter>
    </trigger>
  </style.triggers>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900