WPF RepeatButton鼠标向上 [英] WPF RepeatButton MouseUp

查看:202
本文介绍了WPF RepeatButton鼠标向上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种方法可以使当不再按下按钮时,重复按钮上的MouseUpevent触发?我试图使用MouseMove事件来跟踪按下按钮时鼠标的位置,但是MouseDown和MouseUp都不会为鼠标左键触发一个事件. 关于可以做什么的任何想法或建议?谢谢

Is there a way to get the MouseUpevent on the repeatbutton to fire when the button is not pressed anymore? I am trying to use the MouseMove event to track the position of the mouse while the button is pressed, but neither MouseDown nor MouseUp fire an event for the left mouse button. Any ideas or advice as to what can be done? Thank you

推荐答案

似乎重复按钮将事件标记为内部处理.在RepeatButton将其标记为已处理之前,可以使用PreviewMouseLeftButtonUp隧道事件来捕获该事件:

It appears that the repeat button is marking the event as handled internally. You can use the PreviewMouseLeftButtonUp tunneling event to catch the event before RepeatButton marks it as handled:

<RepeatButton x:Name="bob" PreviewMouseLeftButtonUp="bob_MouseUp" >
   Repeatinator!!
</RepeatButton>

这篇关于WPF RepeatButton鼠标向上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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