Share via


Find/Command Box

The Find/Command box has two functions; by default, it allows you to search and replace text and execute commands. In addition, you can use the Find/Command box to issue single Visual Studio .NET commands, if you preface them with a greater than (>) character.

The Find/Command box retains the last 16 items entered and displays them in the drop-down list. You can navigate through the list by using the arrow keys. The Find/Command box is located on the Standard Visual Studio .NET toolbar.

Find/Command Box

To go to the Find/Command box, either click it with the mouse or press CTRL+/.

Find and Replace

By default, when you type text into the Find/Command box and press ENTER, it searches for the text in the current document or window using the search and replace options specified in the Find and Replace dialog boxes. For more information, see Searching and Replacing.

You can also use certain key combinations with the Find/Command **** box.

To In the command box
Find a string Type the string and press ENTER
Find the next occurrence of the string Press ENTER
Search the Help index Type the string and press F1
Navigate to a specific line of code Type the line number and press CTRL+G
Find an object Type the string and press F2

When you search from the Find/Command box, the Find Results 1 window appears, displaying the current search settings. If, for example, the last time you searched from the Find dialog box you selected Match case, the Find Results 1 window would display

Find "mybutton", Match case, Current document

Entering Commands

To use the Find/Command **** box to issue a single Visual Studio .NET command or alias rather than search for text, enter the Visual Studio command, prefaced with a greater than (>) symbol. For example:

>File.NewFile c:\temp\MyFile /t:"General\Text File"

Alternatively, you can also use the Command window to enter and execute single or multiple commands. Some commands or aliases can be entered and executed by themselves; others have required arguments in their syntax. For a list of commands, see Visual Studio Commands. For a list of commands that have arguments, see Visual Studio Commands with Arguments.

Escape Characters

A caret (^) character in a command line means that the character immediately following it is interpreted literally, rather than as a control character. This can be used to embed straight quotation marks ("), spaces, leading slashes, carets, or any other literal characters in a parameter or switch value, with the exception of switch names. For example,

>Edit.Find ^^t /regex

A caret functions the same whether it is inside or outside quotation marks. If a caret is the last character on the line, it is ignored.

See Also

Command Window | Pre-defined Visual Studio Command Aliases | Visual Studio Commands with Arguments