Share via


How to: Go To a Line of Code

The integrated development environment (IDE) provides a variety of tools for moving 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 using the Next / Previous Bookmarks commands. For more information, see How to: Bookmark Code.

  • Mark lines of code in the Code Editor with 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 the Object Browser or Class View 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 specific line of code you need 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, enter a number within the allowable range and click OK.

    The insertion point moves to the beginning of the line entered.

See Also

Reference

Bookmark Window

Task List (Visual Studio)

Error List Window

Output Window

Object Browser

Class View