Link to home
Start Free TrialLog in
Avatar of irashkin
irashkin

asked on

how to determine what events are being raised?

Is there a simple way, or a way at all, in Visual Studio .NET to either see exactly what is happening in response to a user event, or to otherwise return the name of the event being handled? For example, the windows.forms datagrid control has many events. But handling the ones I want to respond to, like Click, doesn't always seem to work as planned. And sometimes it is unclear to me what, if any, events will handle things like the focus moving  (by tab key, for instance), to a different cell in the grid. I would like to see all the events that are being fired so that I can find the best place to put my code that needs to get triggered. I guess I could just put a debugger in every event and see which ones get hit, but I'm hoping that microsoft may have provided a way for this to happen automatically.
Is this pie in the sky?
thanks,
ian
Avatar of thenrich
thenrich

put a trace.writeline in your events and watch what is happening in the output window. Or if you wanna get fancy do a trace.assert to put a condition on it.
Avatar of irashkin

ASKER

thanks, but that's what I said I wanted to avoid. (trace, debug, whatever) - the point is, unless I know what events are going to be fired, I have to put a trace in each one, and I don't want to do that. My hope was that microsoft had built a feature to do this automatically instead of me having to code it up by hand.
Any other ideas?
thanks,
ian
"I guess I could just put a debugger in every event and see which ones get hit, but I'm hoping that microsoft may have provided a way for this to happen automatically. "
ASKER CERTIFIED SOLUTION
Avatar of fulscher
fulscher

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial