getting the debugger to break at the next click event

user734028 picture user734028 · Jan 5, 2015 · Viewed 9.7k times · Source

in a .net windows forms project which has 100s of forms, and all those forms has countless custom made controls with base classes involved, its very difficult for me to know where a particular button is, i mean whats the form name which I'm looking at while i'm running the application, and where exactly is the button click event, in code, of the button that I just clicked. Is there a debugging feature in Visual Studio, which would just break the execution for me to the line where the click happened. Can I tell VS to break at which ever Click event comes next? (running visual studio 2012/13 these days).

thanks.

Answer

Jakob Olsen picture Jakob Olsen · Jan 5, 2015

Just before you click the button in the program do this:

Go to visual studio and pause the program. Just press the pause button. Then press F11 (Step Into).

Now press the button in the program, and you should be taken into the event handler.