C # shortcut keys for expanding and folding code

Source: Internet
Author: User

C # shortcut keys for expanding and folding code

It is really convenient and practical to expand and collapse the code in the VS2005 code editor. The following are the shortcut keys used to expand and collapse code. They are commonly used:

Ctrl + M + O: collapse all methods

Ctrl + M: collapse or expand the current method

Ctrl + M + L: show all methods


Solve the problem of missing toolbox in VS2010:

Press the shortcut key Ctrl + Alt + X

Full Screen: Shift + Alt + Enter
Comment selected content: Ctrl + E + C/Crtr + E + U
Code formatting: ctrl + E + F

==========================================
Tips for using VS2008-Shortcut Keys
1. How to adjust the code layout format?
Select: Edit-> advanced-> set document format or edit-> advanced-> set the format of the selected code.
Format the cs code: Ctrl + k + f
Format aspx code: Ctrl + k + d


2. How to jump to a specified row?
Two Methods: I. Ctrl + G II. Double-click the row number in the status bar


3. How to Create a rectangular selection area?
Two Methods: I. Hold down the alt key and drag the mouse.
Ii. Press Shift + Alt and click the upper left and lower right positions of the rectangle.


4. How to quickly hide or display the current code segment?
Ctrl + MM


5. How to quickly switch between different windows?
Ctrl + Tab


6. How to generate a solution?
Ctrl + Shift + B


7. How to quickly add code segments?
Enter prop and press tab twice to insert automatic attributes.
Public int MyProperty {get; set;
}

(Input tryclassforeach and so on. Pressing two tabs also has a similar effect .)


8. How to call smart prompts?
Two Methods: I. Ctrl + J II. Alt + →


9. How to call the parameter information prompt?
Place the cursor over the parameter name, and enter Ctrl + Shif + space.


10. How can I view the detailed definition of the code?
Open: View-> Code definition window
Then you can point the mouse to a method on the page.


11. How to create a region to facilitate code reading?
# Region
Code Area
# Endregion


12. How can I modify attributes of multiple controls at the same time?
Select multiple controls and right-click the attributes. The common attributes of these controls will appear. After modification, all the controls will change.


13. How to quickly add a namespace?
For a class that references a dll but does not reference its namespace in the code, enter the class name and press Ctrl + on the class name.
You can automatically add the reference namespace statement for this class.


14. How can I quickly copy or cut a row?
The cursor can copy or cut the row as long as it is on a line without selecting this line. Press Ctrl + c or Ctrl + x.


15. How to Use the task manager?
If the project we developed is large and some code in the project is not complete, we can mark it for future search.

Create method: Enter: // TODO:... content...
Usage: View-> task list-> comment


16. Command Line Quick Start
"Inetmgr" IIS manager. You don't have to go to management to find it. It will soon show IIS management.
"Sqlwb" Quick Start SQL2005 Enterprise Manager
"Isqlw" is provided by SQL2000. This can be used as the SQL2000 query analyzer.
"Devenv" starts the corresponding version of VS Studio


17. Ctrl prompts transparent window
This is an interesting key. In VS2005, When you debug the code, sometimes the prompt information will block the Code. At this time, you can press CTRL to display the prompt transparently. This transparent effect of VS2008 can be seen in more places. You may wish to see it yourself.


18. F12, Ctrl + minus sign, CTRL + SHIFT + minus sign
These three keys are particularly useful when viewing code. With F12, you can quickly find a function definition. With Ctrl + minus signs, you can quickly return to the function call.

[From: http://hi.baidu.com/caozhiping_up/item/d2b7540526751714eafe38d1]

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.