如何使WPF鼠标事件? [英] How can made wpf mouse event ?
本文介绍了如何使WPF鼠标事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使wpf鼠标事件?
查看更多:C#
请问如何在鼠标离开按钮上的wpf c#中添加代码? ,但是您只需要在XAML中添加
MouseLeave ="Button_MouseLeave"/>
,然后在后面的代码中创建处理程序即可,如下所示:-
私有 无效 Button_MouseLeave(对象发件人,MouseEventArgs e)
{
// 在此处添加代码
}
我认为您应该在鼠标离开事件中解释您要做什么,以便我们提供更多帮助.
How can made wpf mouse event?
See more: C#
Please how can I add code in wpf c# on mouse leave button?
解决方案
OK, I am going to guess that there is more to this than handling the Mouse Leave event, but you just need to addMouseLeave="Button_MouseLeave"/>to your XAML, and then you create the handler in the code behind like this:-
private void Button_MouseLeave(object sender, MouseEventArgs e) { //Add code here }
I think you should explain more about what you are trying to do inside the mouse leave event so we could help more.
这篇关于如何使WPF鼠标事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文