How to: Go To a Line of Code

The integrated development environment (IDE) provides a variety of tools that let you move through documents to locate particular lines of code. For example, you can:

  • Bookmark lines of code in a file in the Bookmarks window, and then navigate through all bookmarks by using the Next Bookmark and Previous Bookmark commands. For more information, see How to: Bookmark Code.

  • Mark lines of code in the code editor by using task reminder comments that begin with task comment tokens (for example, TODO), and then select these reminders in the Task List to jump to the lines they mark in the active document. For more information, see How to: Create Task List Comments.

  • Use Object Browser, Navigate To, Find Symbol, or Go to Definition to locate symbols for objects and their members in your code. For more information, see How to: Search for Objects, Definitions, and References (Symbols).

Go to a Line of Code

If you know the number of a specific line of code you want to view in an open document, you can navigate directly to that line number. If line numbers are not visible in the editor, see How to: Display Line Numbers in the Editor.

To move to a specific line of code

  1. On the Edit menu, click Go To.

  2. In Line number, type a number within the allowable range and click OK.

    The insertion point moves to the beginning of the line that has that number.

See Also


Bookmark Window

Task List (Visual Studio)

Error List Window

Output Window

Object Browser

Class View