Visual Studio Hacks
Tips

Quickly Navigate Code with the Code Definition Window

by dstokes on June 29, 2008

There are a few hidden gems in Visual Studio that are easy to overlook.  One of those is the Code Definition Window (ctrl+\,ctrl+d or View – Code Definition Window).

The Code Definition Window will work in two different ways.  The first is with your current code editing window.  As you navigate your code, the Code Definition Window will display the definition of the objects currently under your cursor.  For instance, if your cursor is currently over a class level variable, the Code  Definition Window will display the location in the source file where the variable is declared.  The same goes for methods and classes both within the current source file and in other source files within your current solution.

The second way the Code Definition Window can work is in conjunction with the Visual Studio Class View Window (ctrl+shift+c or View – Class View).  The Class View Window is a handy tool window in its own right, giving a quick overview of the object model of the current solution and allowing fast navigation through namespaces, classes, and methods.  If you double click on a method in the Class View Window, Visual Studio will open the appropriate source code file and scroll to that particular method.  This is quite useful for larger projects and for projects that might have multiple class definitions in each file.  However, if you single click on a method, the contents of that method will show in the Code Definition Window without opening the file in a text editing window. 

I hope this tip helps you out and adds another tool to your Visual Studio code editing arsenal.

{ 2 comments }

Dew Drop - June 30, 2008 | Alvin Ashcraft's Morning Dew June 30, 2008 at 5:01 am

RE: Quickly Navigate Code with the Code Definition Window

Pingback from Dew Drop – June 30, 2008 | Alvin Ashcraft’s Morning Dew

Quickly Navigate Code with the Code Definition Window June 30, 2008 at 10:55 am

RE: Quickly Navigate Code with the Code Definition Window

You’ve been kicked (a good thing) – Trackback from DotNetKicks.com

Comments on this entry are closed.

Previous post: Visual Studio Links #43

Next post: Visual Studio Links #44