Solved

how to determine what events are being raised?

Posted on 2004-09-20
4
141 Views
Last Modified: 2010-04-23
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
0
Comment
Question by:irashkin
4 Comments
 
LVL 5

Expert Comment

by:thenrich
ID: 12103990
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.
0
 

Author Comment

by:irashkin
ID: 12104138
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. "
0
 
LVL 12

Accepted Solution

by:
fulscher earned 500 total points
ID: 12107513
ian,

I'm afraid there's not such a utility - as far as I know. However, in practice, it isn't as bad. What I usually do if I want to figure out event sequence problems is to eliminate all events which are NOT involved and use WriteLine statement in those few that remain - usually, 2 to 5.

Sorry.

Jan

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now