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 2003+

Visual Studio Find Selected Text

Visual Studio provides many tools for navigating code. Some of the search tools allow complex queries to be created to isolate specific text within source code. Others, like the one described here, are simplistic but allow very fast movement through text.

Finding the Selected Text

You probably use the Find and Replace dialog box, which can be displayed by pressing Ctrl-F, regularly. It allows you to search your code for specific characters, words, phrases or patterns. Various options can be configured to ensure that you find exactly what you are looking for.

Visual Studio provides another method of finding characters, known as the Find Selected Text function. Rather than using a dialog box, you simply highlight the text that you wish to find within a code editor window. You can then press Ctrl-F3 to find the next occurrence of the selected text and Ctrl-Shift-F3 to move to the previous one. Once you have started searching in this way, you can continue by pressing the same key combinations or by dropping the Ctrl and using either F3 or Shift-F3.

When you use the Find Selected Text function the scope of the search and other options used are those of the previous search performed using the Find and Replace dialog box. The active options are displayed in the status bar as you search.

3 January 2011