Share via


Navigating and Searching (Visual C#)

Visual C# provides the following tools to help you navigate and search through source code, project files, and open windows.

  • Class View

  • Navigation Bars

  • CTRL-TAB Navigation

  • Find in Files

  • Object Browser

  • Navigation Stacks

Class View

The Class View window provides a view of your project that is based on classes instead of files, as in Solution Explorer. You can use Class View to quickly navigate to any class or class member in your project. To access Class View, click Class View on the View menu.

Class View

CTRL-TAB Navigation

At any given time, you may have several active windows in a Visual C# project. To quickly navigate to a window, press CTRL+TAB to display a window that lists all your active tools and source code windows. Move the arrow keys while holding down the CTRL key to select the window to display.

Alt Control Navigation Through Files

At the top of every code editor window is the navigation bar, which consists of two list boxes. The one on the left lists all the classes defined in the current file, and the one on the right lists all the members for the class that is selected in the left list box. You can locate a method by selecting it in the right list box.

Navigation Bar

Find in Files

By pressing CTRL+SHIFT+F you can open the Find in Files dialog box to perform search and replace operations across a project.

Note

To rename methods or types, or change method parameters, use the refactoring feature, which is more complete and intelligent than search and replace. For more information, see Refactoring.

Object Browser

You can use the Object Browser to navigate source code. First, view the symbols in your solution by narrowing the scope of the Object Browser to My Solution. Then, navigate to the code by right-clicking a symbol and clicking Find All References or Go To Definition.

Visual Studio tracks and remembers cursor movement in the navigation stack. Use CTRL+- to navigate backwards to the previous cursor location and CTRL+SHIFT+- to navigate forwards to the last cursor location in the navigation stack. You can also navigate the stack by clicking Navigate Backwards and Navigate Forwards in the View menu.

Visual Studio also uses a separate navigation stack to track cursor movement for Go To Definition calls. Use CTRL+SHIFT+8 to move back to the cursor location where Go To Definition was called. Use CTRL+SHIFT+7 to move forward in the navigation stack.

For More Information

See Also

Other Resources

Visual C#

Using the Visual C# IDE