【发布时间】:2017-02-02 22:57:10
【问题描述】:
我想要什么:当任何文本框有焦点时将边框颜色更改为黄色。
我尝试了什么:
<Window.Resources>
<Style TargetType="TextBox">
<Style.Triggers>
<Trigger Property="IsFocused" Value="True">
<Setter Property="BorderBrush" Value="Yellow"></Setter>
<Setter Property="BorderThickness" Value="1"></Setter>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
没有快乐。无法弄清楚为什么边框仍然是蓝色的。 这是相似的,但不是 How to change the color of the Border of a TextBox when it has focus? 的重复。
【问题讨论】: