Useful shortcut keys in VS

Source: Internet
Author: User

Smart tip: Ctrl + J
METHOD parameter hint: CTRL + SHIFT + Space
Smart tags (e.g., prompting using, implementing interfaces, abstract classes, etc.): Ctrl +.

Execute Test: Ctrl + R,T (current context), CTRL + R,a (all), CTRL + R,y (all affected)
Rebuild: Ctrl+shift+b
Implementation of the full text: ctrl+k,d
Loop paste: Ctrl+shift+v
Quick switch to previous/next: Ctrl+f6/ctrl+shift+f6
#region快捷键: Select the content you want to annotate, press ctrl+k,s, select #region

1. Quick using(The shortcut for this is CTRL +.)



2. Quickly return to the previously edited code page
Now the project is dozens of code pages, often need to jump between several pages to jump, then you need these two shortcut keys:
CTRL +-Navigate back to the previous edit cursor point
CTRL + TAB back to the previous document window, Ctrl-Press and hold and press TAB to select the document window you want to toggle. This feature is similar to the ALT + tab of Windows

3. Go To Definition, find references
For example above, to know where the variable arrayList is defined, click ArrayList Press F12 the cursor will jump to arrayList arrayList = new ArrayList ();
Want to know how many places use this variable ArrayList right-click ArrayList Press A.
F12 go To Definition or right click [Object] Press G
Find reference right click on a

4. List members, view parameter descriptions(CTRL + J) (ctrl+shift+ SPACEBAR)
When you enter ArrayList, the corresponding Member list pops up:




view parameter description, move cursor to parameter, press ctrl+shift+ SPACEBAR to display parameter description:



 
5. Other common shortcut keys:
vs shortcut keys too many, not that Kung Fu remember so many shortcut keys, remember a few commonly used is enough

ctrl + SHIFT + B Build Solution
f4 Display Properties window
f5 Run Debug
F10 cross-Program execution
f11 step through
shift+f7: View the form designer
F3: Find the next
Span style= "FONT-SIZE:14PX;" >ctrl+h: Replace   

Shift+alt+f10
Ctrl+k+m
Ctrl+e+d

Ctrl+f5: Start execution (without debugging)
F9: Toggle Breakpoint
CTRL+SHIFT+F9: Delete all breakpoints
Ctrl+shift+f: Finding in Files
Ctrl+k,s: Inserting the outer code

Select one or more lines of code to comment: ctrl+e,c
Select one or more lines of code uncomment: Ctrl+e,u

Format the code with indentation: Ctrl+k,d

Ctrl+k,ctrl+f Finishing Indent formats


1,visual Studio 2008 comes with a variety of icons, cursors, and animation files that are used by more than 1000 Windows systems
In the installation directory of Visual Studio 2008,
\microsoft The Visual Studio 9.0\common7\vs2008imagelibrary\2052 folder below, there is a vs2008imagelibrary.zip, which will be used in the Windows System icon , the cursor, and the animation file are set together. These include office, Win9x, WinVista, and WinXP, which can be used for free.

2, remove redundant using directives, and sort
When we have a new class, Visual Studio uses the usual namespaces in the header of the class. But when we finish writing a class, some using is superfluous, removing the redundant using, and then ordering it 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, do not select it first
If you want to copy a line of code, you just need to simply press CTRL + C to copy and then press CTRL + V to paste the line instead of selecting the entire line of code. If you want to delete a line of code, just press ctrl+x.

4, replace the ctrl+f in other editors convenient incremental search
Using UltraEdit will impress those two up and down search buttons, and there's more in Visual studio.
Operation Method:
1). Press the Ctrl+i key;
2). Type the text you want to search for. Note: At this point you will see that the cursor jumps to the first match and the matching text is highlighted;
3). Press the Ctrl+i key again, the cursor will jump 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 a box selection in the editor
Operation Method:
Do you know that VS offers two different choice models: Streaming and box?
You should be familiar with streaming selection models, just use the shift+ arrow keys (or use the mouse to select them).
The box selection allows you to select both the navigation and the column. Just press the shift+alt+ arrow key at the same time and you'll know the difference. Cut, copy, paste, these functions can be used, just need to remember where to start choosing. Ah, reminds me of the time when I was doing the test.
Note: You can also use the mouse +alt button to complete the operation. I also encountered an interesting usage of the hint two days ago. Sometimes when we copy the code in the article on the net, the line number is copied in together, and the box selection can be used to select only the line number section and delete it.

6, how to use shortcut keys to insert a row above or below the current line of code (recommended, very useful)
Pressing Ctrl+enter inserts a blank line above it, and Ctrl+shift+enter inserts a blank line below it. The cursor moves to the beginning of the new line.
Note: This is one of my favorite shortcut keys, if not, you need to use home or end, and then use the arrow keys, and then use a carriage return to achieve the above effect.

7. After installation, restore your IDE settings to the default settings
If the IDE's settings have been changed in any previously released version, they should be restored to the default settings. You can click menu Tools > Import and Export Settings ... > Reset all Settings in Visual Studio 2008, plus some options for Import and export are available.

8, insert code block two times by pressing "tab"
Operation Steps:
Enter code snippets in the edit, such as "for"

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

At this point you can change the first "I" to "J" and then press the TAB key, then all the variables become "J".
Note: This is fast and not prone to grammatical errors.

9. Open the IDE's navigation with Ctrl+tab to get a bird's eye view
press the "Ctrl+tab" key, Open the IDE Navigator window, press and hold the CTRL key while selecting a file or tool form to activate with the arrow keys or the mouse.

note: At this time it is best not to loosen the "Ctrl+tab", by the direction of the key to see the bird's Eye view, all released to locate the required file or tool form, to say the truth, this window is very cool.

10, find matching tags
11. If you want to temporarily disable a piece of code, you could comment out the code, The method is: Select this code First, then CTRL+K+C (hold CTRL key, then, click the K key, then click the C key), see (Figure 5) (Figure 6). Use Ctrl+k+u to uncomment
12-Create a new item using CTRL + N or Ctrl+shift+a
13 automatic completion with CTRL + SPACEBAR

Shift+alt+enter: Toggle Full Screen editing

Ctrl+m+crtr+o Collapse All Outlines

Ctrl+m+crtr+p: Stopping outline display

Ctrl+k+crtr+c: Comment Selection

Ctrl+k+crtr+u: Deselect Comment content

Ctrl+j: List member IntelliSense

Ctrl+b,t/ctrl+k,k: Toggle Bookmark Switch

Ctrl+b,n/ctrl+k,n: Move to Next Bookmark

Ctrl+b,p: Move to previous bookmark

Ctrl+b,c: Clear All labels
Ctrl+i: Incremental Search

Ctrl+shift+i: Reverse Incremental Search

Ctrl+f: Find

Ctrl+shift+f: Finding in Files

F3: Find the next

SHIFT+F3: Find Previous

Ctrl+h: Replace

Ctrl+shift+h: Replace in file

ALT+F12: Find Symbol (List all find results)

Ctrl+shift+v: Clipboard Looping

CTRL + LEFT and RIGHT arrow keys: One word can be moved at a time

CTRL + UP and DOWN ARROW keys: Scrolls the code screen, but does not move the cursor position.

Ctrl+shift+l: Delete When moving forward

Ctrl+m,m: Hides or expands the currently nested collapsed state

CTRL+M,L: Set all procedures to the same hidden or expanded state

Ctrl+e,s: View Blank

Ctrl+e,w: Wrap Line

Ctrl+g: Go to the specified line

shift+alt+ arrow key: Select Rectangle text

ALT + left mouse button: Select rectangle text

Ctrl+shift+u: All Uppercase

Ctrl+u: All changes to lowercase code shortcut keys

ctrl+shift+ SPACEBAR/ctrl+k,p: Parameter information

Ctrl+k,i: Quick Info

Ctrl+e,u/ctrl+k,u: Deselect Comment content

Ctrl+k,m: Generate Method Stub

Ctrl+k,x: Inserting Code Snippets

Ctrl+k,s: Inserting the outer code

F12: Go to the Definition window shortcut key for the called procedure or variable

Ctrl+w,w: Browser window

Ctrl+w,s: Solution Manager

Ctrl+w,c: Class View

Ctrl+w,e: Error List

Ctrl+w,o: Output View

Trl+w,p: Properties Window

Ctrl+w,t: Task List

Ctrl+w,x: Toolbox

Ctrl+w,b: Bookmark window

Ctrl+w,u: Document Outline

Ctrl+d,b: Breakpoint Window

Ctrl+d,i: Immediate Window

Ctrl+tab: Active form Toggle

Ctrl+shift+n: New Project

Ctrl+shift+o: Open Project

Ctrl+shift+s: Save All

Shift+alt+c: New Class

Ctrl+shift+a: New Item

Shift+alt+enter: Toggle Full Screen editing

Ctrl+b,t/ctrl+k,k: Toggle Bookmark Switch

Ctrl+b,n/ctrl+k,n: Move to Next Bookmark

Ctrl+b,p: Move to previous bookmark

Ctrl+b,c: Clear All labels

Ctrl+i: Incremental Search

Ctrl+shift+i: Reverse Incremental Search

Ctrl+f: Find

Ctrl+shift+f: Finding in Files

F3: Find the next

SHIFT+F3: Find Previous

Ctrl+h: Replace

Ctrl+shift+h: Replace in file

alt+f12: Find Symbol (List all find results)

ctrl+shift+v: Clipboard loop

ctrl+ left and RIGHT arrow keys: You can move one word at a time

ctrl+ up and DOWN ARROW keys: Scrolls the code screen, but does not move the cursor position.

ctrl+shift+l: Delete current line

ctrl+m,m: Hides or expands the currently nested collapsed state

ctrl+m,l: Set all procedures to the same hidden or expanded state

ctrl+m,p: Stop outlining

ctrl+e,s: View Blank

Span style= "FONT-SIZE:14PX;" >ctrl+e,w: Wrap

ctrl+g: Go to the specified line

shift+ ALT + arrow key: Select Rectangle text

alt+ left mouse button: Select rectangle text


ctrl+u: All lowercase

Useful shortcut keys in

vs

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.