I recently saw the Console that the instructor talked about in the C # Video. writeLine () only needs to write down cw, and then press the tab key twice. I didn't know it before, And suddenly felt very useful, so I collected some related shortcut keys, hope to be useful to you.
1. code writing:
Shift + Alt + Enter -- full screen display
Shift -- Alt + F10 ----- open the option for implementing the interface, continue to press I to implement the interface, and rename by R
Ctrl + R + E -------- encapsulate Fields
Ctrl + J ---------- list members, including only code prompts
Tab (press twice) -------- fill the code block, for example, after try, for, do
Ctrl + K + S --------- external code, including code block Template
"Cw" + Tab ------------ Console. WriteLine ();
"Mbox" + Tab ----------- MessageBox. Show ();
Ctrl + Shift + Space ----------- parameter information
F6/Ctrl + Shift + B ----------- generate a solution
F7 ---------- jump to the code behind the form, which can be found in WinForm and WebForm.
2. Code operation:
Ctrl + K + C ------ comment
Ctrl + K + U ------ uncomment
Ctrl + J --------- search for matching parentheses
Ctrl + Shift + J ---------- select matching brackets and their code
Ctrl + F --------- quick search
Ctrl + H --------- quick replacement
Ctrl + Shift + U --------- convert to uppercase
Ctrl + U ------- convert to lowercase
Ctrl + K + D ------- set the document format
Tab --- add indentation
Shift + Tab ------ reduce indentation
Ctrl + M -------- collapse the Code. For example, place the cursor in the position of # region, if, and method header, and collapse them.
3. debug and run:
F5; start debugging
Shift + F5 --- stop debugging
F9 --------- set a breakpoint
Ctrl + Shift + F9 --------- delete all breakpoints
F10 ------ process-by-process debugging
F11 ------ statement-by-statement debugging
4. Project operations:
Alt + Enter ---------- open the Properties dialog box for the selected item
Ctrl + Shift + N ----- create a project
Shift + Alt + N ------- create a website
Ctrl + N --------- create a file
Ctrl + Shift + O -------- open the project
Ctrl + Alt + O ------- open the website
Ctrl + O ---------- open the file
5. View call:
F4 ------- attributes
Ctrl + Alt + X ---- toolbox
Ctrl + Alt + L ------ solution Resource Manager
Ctrl + Alt + S -------- server Resource Manager
Supplement: How do I organize the code in the program?
Ctrl + K + F: indicates the code of the selected or current row.
Ctrl + K + D: Sort all the code
A better method: VS compiler has the alignment function when the code is correct. If there is no alignment, you can delete the last braces and press the braces to automatically sort out the code.