Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Custom shaped button

$
0
0

Hello All,

I have a custom button, where I hide the normal button background, and then display an image instead. The image is png, and can be just about anything, such as a picture of an apple or of a banana.

However I have noticed that the entire rectangular (transparent) part of the png file is still part of the clickable area for the button. How do I make the transparent part non-Clickable?

Here is the code for the button:

<Button x:Name="imageBtn2" Style="{StaticResource MyCustomButton}" Height="50" Width="55" Margin="101,165,104,41" HorizontalAlignment="Left" VerticalAlignment="Top" 
                Background="{x:Null}" Click="Meenie_Click"><Image ToolTip="Meenie" Source="/CustomShapedApplication;component/Images/sheepish-icon.png"/></Button>

Thanks



Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>