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

后端 未结 8 536
北荒
北荒 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条回答
  •  旧时难觅i
    2020-11-28 06:05

    If someone doesn't want to override default Control Template then here is the solution.

    You can create DataTemplate for button which can have TextBlock and then you can write Property trigger on IsMouseOver property to disable mouse over effect. Height of TextBlock and Button should be same.

    
    

提交回复
热议问题