Using the Command Window


If you've used a modal editor such as Vim (Vi improved) for a number of years and are used to typing editor commands at a command line, the Command Window in Visual Studio will come as a welcome surprise. I've already referred to using the Visual Studio Command Window a number of times (in both Chapters 1 and 2), but it's worth considering the various ways you can use this tool in your everyday work.

Tip 

You can clear the Command Window by entering the cls command.

As you've probably noticed by now, the named commands in Visual Studio generally map to menu commands in the IDE. So if you want to use a named command from the Command Window, all you usually need to do is to type the name of the menu containing the command and then the dot operator and the name of the command. For example, if you want to search by using the Command Window, you first bring the window to the front by pressing Ctrl+Alt+A. To open the Find dialog box, type Edit.QuickFind in the Command Window. You'll notice that some commands, such as the Edit.QuickFind command, can take arguments. This means that you can search from the Command Window without having to deal with a dialog box. Whether or not you find this approach better is a matter of personal preference.

There are two ways to get to a command prompt in Visual Studio. The way that we've described in the book so far is to open the Command Window by using the Ctrl+Alt+A shortcut. You can also type commands into the Find combo box on the Standard toolbar by pressing Ctrl+D (Edit.GoToFindCombo). Normally, typing text in the Find combo box simply gives you a quick way to search the currently open document for a term or phrase. When you type a > (greater than) character into the box, the box changes to one capable of taking commands. You can then type named commands in the box that you would usually type in the Command Window. Because both the Command Window and the Find combo box support IntelliSense, you can simply type a named command to see all the possible completions for the command. You can see the list of completions in Figure 3-13.

image from book
Figure 3-13: Command completion in the Find combo box




Working with Microsoft Visual Studio 2005
Working with Microsoft Visual Studio 2005
ISBN: 0735623155
EAN: 2147483647
Year: 2006
Pages: 100

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net