【发布时间】:2011-12-22 17:16:56
【问题描述】:
当鼠标悬停时,我正在尝试将 OuterGlowBitmapEffect 效果添加到 TextBox。
我使用触发器。这是一些代码:
<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>
但它不起作用。我错过了什么?
【问题讨论】:
-
你不应该使用
BitmapEffect。
标签: c# .net wpf triggers styles