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

后端 未结 8 514
北荒
北荒 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:21

    This is similar to the solution referred by Mark Heath but with not as much code to just create a very basic button, without the built-in mouse over animation effect. It preserves a simple mouse over effect of showing the button border in black.

    The style can be inserted into the Window.Resources or UserControl.Resources section for example (as shown).

    
        
        
    
    
    
    
    

提交回复
热议问题