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

Change opacity of button background image on hover

$
0
0
Hello,

I'm fairly new to WPF and at the moment I'm trying to create a image button with hover effect. I made a button with an image as background and now I would like to change the opacity of the image on hover.

<Button Style="{ StaticResource ImageButton}" Width="16" Height="16" VerticalAlignment="Top" Margin="0,0,30,0" HorizontalAlignment="Right"><Button.Background><ImageBrush ImageSource="<MyImage>"/></Button.Background></Button>
I tried it like this within my style template

<Style.Triggers><Trigger Property="IsMouseOver" Value="True"><Setter Property="Opacity" Value="70"/></Trigger></Style.Triggers>

But it doesn't work so far.

Maybe someone has some suggestions for me. 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>