谁处理了我的活动 [英] Who handled my event

查看:62
本文介绍了谁处理了我的活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在TextBox上注册了一个LostFocus事件但事件并没有被捕获 - 我的猜测是其他人处理了它。

我尝试过使用snoop但它只显示了我MouseDown和MouseUp事件(我需要LostFocus)。

关于如何找到的任何想法?



谢谢



更新:

用于注册活动的代码示例



eventInfo.AddEventHandler(cloningObject ,eventDelegate);

I have registered to a LostFocus event on a TextBox and yet the event is not catch - my guess is that someone else handled it.
I've tried using snoop but it only shows me the MouseDown and MouseUp events (and I need the LostFocus).
Any ideas on how can I find out?

Thanks

Update:
code sample for registering to the event

eventInfo.AddEventHandler(cloningObject, eventDelegate);

推荐答案

你不应该使用LostFocus,你应该使用Enter和Leave事件。



见这里:



MSDN LostFocus事件 [ ^ ]



LostFocus事件可能不会触发,具体取决于t他处理了UICues。无论哪种方式,都无法取消LostFocus事件,因此即使其他人确实附加了它,它也不会取消附加事件处理程序或阻止它被调用。
You shouldn't be using LostFocus, you should use the Enter and Leave events.

See here:

MSDN LostFocus Event[^]

The LostFocus event may not fire depending on how the UICues are handled. Either way, there is no way to cancel a LostFocus event, so even if somebody else did attach to it, it wouldn't unattach your event handler or stop it from being called.


这篇关于谁处理了我的活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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