如何删除 WPF 按钮上的默认鼠标悬停效果? [英] How to remove default mouse-over effect on WPF buttons?

查看:40
本文介绍了如何删除 WPF 按钮上的默认鼠标悬停效果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是,在 WPF 中,每当我尝试使用触发器或动画更改按钮背景的颜色时,默认的鼠标悬停效果(带有橙色发光的灰色)似乎优先.

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 orange glow) seems to take priority.

经过大量搜索,我对如何消除这种影响一无所知.

After extensive searches I'm clueless as to how to remove this effect.

推荐答案

您需要创建自己的自定义按钮模板才能完全控制所有状态下的外观.这是一个教程.

You need to create your own custom button template to have full control over the appearance in all states. Here's a tutorial.

这篇关于如何删除 WPF 按钮上的默认鼠标悬停效果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆