tags:

views:

70

answers:

2

i have windowapplication project which contain so many forms ,,i need to debug the application ,,but i dont know which code is related to which UI window,..Is there any way to find the code which correspond to related window

+1  A: 
  • Open the windows and press 'F7'
  • Right click on the form and say "View code"
  • Right click the form in Solution explorer and say "View code"

If you mean other files not related to the UI you can do a "Find all references" when you right click on a specific function. This shows you all places where this function is called.

PVitt
this every one knows ,,but the thing is that i dont know when it will reach to UI window
peter
in such big project ,,if i put breakpoint in code behind,,after running code ,,i want to search until the break point reaches .Thats the problem
peter
I don't understand what you want? You press F5 and wait for the breakpoint to hit? If breakpoint hits, you press F5 again until next breakpoint hits and so on. I'm sorry if i totally misunderstand.
Ezombort
Do what PVitt says, on the form of your choise, do A find all references on the form's constructor, then you win find where all the instances are created...
Stormenet
A: 

I think you're looking for an easy way to locate the code for a particular form easily without having to go through the entire codebase to determine what code goes with what form. Unfortunately, there are no easy ways that I am aware of. However, there are a couple of things that you can try:

  • If the form you're looking at has some sort of a lengthy operation and you're quick enough :-), you can trigger that operation and immediately do 'Break All' from the debug menu or hit 'Ctrl+Alt+Break' to break the execution right there and examine the stack trace.
  • You can profile your application e.g. performance exporer in VS2008 and then examine the profiler reports to get some hints as to what code is getting called. This may pinpoint or at least narrow down the code you're looking for.

Just a couple of ideas that might helpful.

Mehmet Aras