简体   繁体   中英

How to view/monitor which events are being fired from controls on a user interface

I am creating an GUI using winforms in C#, all the controls have numerous events. I would like to know which of these events are being fired and when. One way would be to put debug statements on each of the event handlers but that would require too much work. Is there any way of doing this in Visual Studio 2008/2010 or are there any tools that can help?

Managed Spy has possibility to log all events of chosen control. See this article where you can read about this tool and download it.

运行时流程 (由我开发)与监视过滤器“Module == System.Windows.Forms.dll && Function == On *”将显示为所有winforms控件触发的事件。

If you don't mind some information overload, you could use Spy++ (\\Common7\\Tools\\Spyxx.exe) to see all the windows messages generated by the application.

Some of the window messages translates more or less directly to .net events...

You could write a logging class that subscribes to these events and write the event plus the time stamp into a log file.

It still requires that you write some code, but it's independent of your production code and shouldn't affect it any way.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM