Solved

how to determine what events are being raised?

Posted on 2004-09-20
4
145 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

697 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