Why does TextBox Border Colour insist on and not changing in WPF?

后端 未结 2 1877
既然无缘
既然无缘 2021-01-12 13:08

As far as I understand I should be using Style triggers to update the TextBox\'s border colour when it is focused. However no matter what I do it always turns to the system

2条回答
  •  悲&欢浪女
    2021-01-12 13:52

    Default template of TextBox has trigger which set the border brush of textBox. In case you want to override it, you need to override ControlTemplate of TextBox.

    This is how you do that:

    
    

    Also you might want to override MouseOver brush to Black in above template. You can do that by supplying color value for UIElement.IsMouseOver trigger.

提交回复
热议问题