捕获任何事件 [英] Capture any Event

查看:81
本文介绍了捕获任何事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的

是否有任何全局方法可以捕获应用程序中触发的任何事件.

Is there any global way to capture any event fired in my application.

表示是否单击了form1中的button1,例如,我想提醒(messageBox.show)以下内容:button1-form1-button1_Clicked;

Means if a button1 was clicked in the form1 i want for example to alert(messageBox.show) the following: button1 - form1 - button1_Clicked;

最主要的是我想要一个全局函数,该函数不允许在每个事件中都放置代码

the main thing is that i want a global function that will allow not to put the code in every event

预先感谢

推荐答案

可能是您需要的这篇文章:

Probably, this article is what you need:

http://www.codeproject.com/KB/cs/eventtracingviareflection.aspx


好吧,对我而言,并没有帮助
well didn''t help, as much as i''m concerned


我只是浏览了这篇文章. Tracer类(不确定此名称是否正确)似乎*知道*表单中发生了所有事件.您需要类似的机制.尽管一旦知道发生了一些事件,就需要进行一些活动.如果您可以在您的应用程序中创建一些类似的东西,并根据需要进行一些调整,那么我想您会成功的.
I just browsed through the article. The Tracer class (not sure if this is the correct name) seems to *know* what all events have occured in the form. You need similar mechanism. Although you need to do some activities once you know some event has occured. If you can create some thing similar in your application and just tweak a bit as per your needs, I guess you will be done.


这篇关于捕获任何事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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