Change backgorund of button in wpf when it has focus

后端 未结 2 1804
温柔的废话
温柔的废话 2020-12-21 15:53

I have a button and I want to change the background color of button. but when I set the background property to a color like blue:

2条回答
  •  萌比男神i
    2020-12-21 16:37

    I believe that your problem is caused by the default ControlTemplate for the Button control. The colour animations that you describe are defined in this ControlTemplate and so you need to provide your own ControlTemplate to remove this behaviour:

    
    

提交回复
热议问题