How to remove default mouse-over effect on WPF buttons?

后端 未结 8 547
北荒
北荒 2020-11-28 05:42

My problem is that in WPF, whenever I try and change the colour of a button\'s background using triggers or animations, the default mouseover effect (of being grey with that

8条回答
  •  广开言路
    2020-11-28 06:27

    Just to add a very simple solution, that was good enough for me, and I think addresses the OP's issue. I used the solution in this answer except with a regular Background value instead of an image.

    
    

    No re-templating beyond forcing the Background to always be the Transparent background from the templated button - mouseover no longer affects the background once this is done. Obviously replace Transparent with any preferred value.

提交回复
热议问题