Solved

how to determine what events are being raised?

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

757 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

22 Experts available now in Live!

Get 1:1 Help Now