I’m trying to add OuterGlowBitmapEffect effect to TextBox when Mouse hovers it.
I use triggers. Here is some code:
<TextBox Height="23" HorizontalAlignment="Left" Style="{DynamicResource TextBoxStyle}" Margin="12,283,0,0" Name="textBox1" VerticalAlignment="Top" Width="147" Text="" />
<Style x:Key="TextBoxStyle" TargetType="{x:Type TextBox}">
<Setter Property="FontSize" Value="14" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BitmapEffect">
<Setter.Value>
<OuterGlowBitmapEffect GlowColor="Red" GlowSize="10"/>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
But it’s not working. What i missed?
From the documentation of
BitmapEffect:You can simulate a glow using the
Effectproperty with an instance ofDropShadowEffect.