Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要更改活动控件的背景颜色(以便更容易识别光标的位置)。
我尝试在 IsFocused 属性上使用带有触发器的样式,但我一点运气都没有;它似乎没有开火。
XAML 解决方案是最优选的。
我一直在玩,这似乎运作良好:)
<Style TargetType="{x:Type TextBox}"> <Style.Triggers> <Trigger Property="IsFocused" Value="True"> <Setter Property="TextBox.Background" Value="Gray" /> </Trigger> </Style.Triggers> </Style>