To design a button in Wpf like google search icon

763 views Asked by At

I'm trying to design a button and below is my code, but here the background is coming white and on click button border is highlighted, but what i'm trying is to design is a button like google search button, or like bookmark icon in search browser, in that button shape is like the icon and no border is shown on click ,

 <Button Name="LoadDllButton"  Margin="46,10,414,6" Width="41" >
    <Button.ContentTemplate>
    <ItemContainerTemplate>
        <Image  Source='\RibbonImages\search.png' Width="58" Height="18" />
    </ItemContainerTemplate>
</Button.ContentTemplate>
   </Button>
1

There are 1 answers

2
Benjamin Guino On

Just set the background, border brush and foreground to null or transparent. I inserted it in your code.

<Button Name="LoadDllButton" Margin="46,10,414,6" Width="41" Background="{x:Null}" BorderBrush="{x:Null}" Foreground="{x:Null}" >
<Button.ContentTemplate>
<ItemContainerTemplate>
    <Image  Source='\RibbonImages\search.png' Width="58" Height="18" />
</ItemContainerTemplate>
</Button.ContentTemplate>
</Button>