开发者

Outer and Inner Glow with transparent WPF Buttons

I want my WPF Button to get an outer glow effect when the mouse hovers over it. How can I achieve this when the Button is transparent?

When I use a BitmapEffect such as a DropShadow or OuterGlow the glow appears at the 开发者_StackOverflow中文版inside of the Button as well because it is transparent. But I want the glow to be only at the outside.


Have you tried adding the outer glow to a border?

<Border Width="100" Height="100" Background="Transparent" BorderBrush="White" BorderThickness="1">
    <Border.BitmapEffect>
        <OuterGlowBitmapEffect GlowColor="Red" GlowSize="3" Opacity="1" />
    </Border.BitmapEffect>
</Border>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜