Visual Studio 2008 Common Tips

Source: Internet
Author: User

1,visual Studio 2008 's various icons, cursors, and animated files with more than 1000 Windows systems in use


under the installation directory of Visual Studio 2008,


Microsoft Visual Studio 9.0common7vs2008imagelibrary2052 folder, there is a vs2008imagelibrary.zip, which will be used in the Windows System icon , cursors, and animation files are concentrated together.  including office, Win9x, WinVista and WinXP, and other systems used, can be used for free OH.





2, remove redundant using directives, and sort


when we have a new class, Visual Studio uses the common namespaces using the head of the class. But when we finish writing a class, some of the using is superfluous, remove the redundant using, and then arrange the order to make the code look clearer. Visual Studio 2008 has done all this for us. Right-click in the code editing area to see the "Organize using" menu, which is what we need.





3, when copying or deleting a line of code, you do not have to select it first


If you want to copy a line of code, you simply press CTRL + C to copy it, and then press CTRL + V to paste the line, without having to select the entire line of code. If you want to delete a line of code, just press ctrl+x.





4, replacing ctrl+f in other editors for easy incremental lookups


used UltraEdit to be impressed with the two search buttons up and down in Visual studio.


Operation Method:


1). Press ctrl+i key;


2. Type the text you want to search for. Note: At this point you will see the cursor jump to the first match where the matching text is highlighted;


3). When you press the Ctrl+i key again, the cursor jumps to the next matching text;


4). Press Ctrl+shift+i to search backwards;


5). To stop the search, press the ESC key;





5, How to make box selection in the editor


Operation Method:


Do you know vs offers two different choice models: Streaming and frame?


you should all be familiar with the streaming selection model, just use the shift+ arrow keys (or use the mouse to choose).


Box selection allows you to select both the navigation and the column. Just press the shift+alt+ key at the same time and you'll see what's different. Cut, copy, paste, these functions can be used, just need to remember where to start the selection.  Ah, reminds me of the time when I was doing the test.


Note: You can also use the mouse +alt key to complete the operation. I also encountered an interesting use of the hint the other day. Sometimes when we copy the code from an online article, we handcuff the line number together, and you can delete it by using the box selection to select only the line number section.





6, how to insert a row above or below the current line of code using a shortcut key (recommended, very practical)


Press Ctrl+enter inserts a blank line above, and Ctrl+shift+enter inserts a blank line below.  The cursor is moved to the beginning of the new line.


Note: This is a shortcut I like very much, if not this, you need to use the home or end, and then use the arrow keys, and then use the carriage return to achieve the above effect.





7, after installation, restore your IDE settings to the default settings


If the IDE's settings are changed in any previous release, they should all be restored to the default settings. You can click menu Tools > Import and Export Settings in Visual Studio 2008 ... > Reset all settings, in addition to some Import and export options available.





8, insert the code block by pressing "tab" two times


Operation steps:


Enter code snippets in the edit, such as "for"





in this state, pressing the TAB key two times will insert a block of code, as shown in the following figure





at this point you can change the first "I" to "J" and press the TAB key, then all the variables become "J".


Note: This is fast and not easy syntax error.





9, use Ctrl+tab to open the IDE's navigation and get a bird's-eye view


also navigates to all open file and tool forms in Visual Studio


press the "Ctrl+tab" key to open the IDE navigation window, hold down the CTRL key, and use the arrow keys or mouse to select a file or tool form to activate.





Note: At this time, it is best not to release the "Ctrl+tab", according to the arrow keys to see the aerial view, all released after the location to the required file or tool form, to be honest, this window is very cool.





10, find a matching tag


Some identities always appear in pairs. For example, the "{" Identity must be closed with the corresponding "}" identity. Although you click on a {and it matches the} will be highlighted, but if the code is too long to find, similarly, the compiler indicator "#region" must have a corresponding "#endregion" indicator. When navigating your code, you sometimes need to find the corresponding identity. You can do this by pressing Ctrl-O. This shortcut only works when the cursor is below either of these identifiers, and it immediately jumps to the corresponding identifier regardless of whether it is an open or closed identity.


If you want to highlight all of the code between two matching identities, press ctrl-shift-to highlight the entire block and move the cursor to the Open tab. This shortcut key works only if the cursor is below an arbitrary identity (such as the cursor does not work in the region).

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.