This web site uses cookies. By using the site you accept the cookie policy.This message is for compliance with the UK ICO law.

Visual Studio
VS 2005+

Visual Studio Code Definition Window

When working with large projects with numerous classes and references, it can be difficult to remember how every method works. The Code Definition Window helps by automatically looking up definitions and displaying their signatures or source code.

Code Definition Window

If you have a solution that contains a large number of classes and members, or uses lots of referenced assemblies or .NET framework classes, it can be difficult to remember how every dependency operates. It can be more difficult still if you have not previously used the dependencies. You may find that you are often jumping between the code you are working on and the source code or definition of another class or member in order to jog your memory.

Visual Studio includes a tool called the Code Definition Window. This is a read-only code window that automatically updates as you select symbols such as classes, methods or properties. If you click or select a symbol for which you have access to the source code, the code is displayed. For other items, such as the .NET framework's classes, the declaration of the selected item is shown, along with any documentation comments related to it.

To show the tool, select the "Code Definition Window" option from the Tools menu. The code definition is usually displayed beneath the code editor, though it can be moved and docked like other windows. Below you can see a code editor where the MaximumClockSpeed property is selected. Beneath is the read-only code definition window showing the details of this property.

Visual Studio Code Definition Window

Although the Code Definition Window provides a read-only view, it otherwise acts like a standard code editor. You can copy and paste code from it and right-click elements to open context-sensitive menus containing options that allow you to perform tasks such as jumping to definitions and setting breakpoints and tracepoints.

22 November 2011