Tips and tricks for using Visual Studio

Source: Internet
Author: User
Tags function definition visual studio

Keep your hands on the keyboard

Keyboard shortcuts I like to use most

Have you ever had the expectation that you didn't have to leave the keyboard while you were working on your development inside Visual Studio? If you are an advanced user, you will certainly enjoy the rapid experience of using keyboard shortcuts to perform a variety of operations. I'm sure most developers are already familiar with some of these shortcuts. Use F5 to perform debug.start, F10 execution debug.stepover, F4 execution view.properties, and so on. There are, however, several other, less-known but extremely useful keyboard shortcuts. In the following table, I list some of the shortcuts I like to use most.

f7
f9
f12
Fast forward and backward navigation in the go To definition stack.
shift+f12
ctrl+m, ctrl+m in editor Expands and collapses the code snippet structure.
shift+alt+enter
ctrl+i incremental search.

Create keyboard shortcuts quick look-up table

Most developers don't understand this, but in fact, Visual Studio defaults to providing more than 450 keyboard shortcuts. However, there is no easy way to find all keyboard shortcuts within Visual Studio. You can write a simple macro that iterates through all the default keyboard shortcuts and finds the actions that they correspond to. The following (Listing 1) lists the code for this macro.

public Module Module1
Public Sub listshortcutsinhtml ()
' Declare a StreamWriter
Public Sub writehtmls Tart (ByVal SW as System.IO.StreamWriter)
SW. WriteLine (" SW. WriteLine (" SW. WriteLine ("<title>")
SW. WriteLine ("Visual Studio keyboard shortcuts")
SW. WriteLine ("</title>")
SW. WriteLine (" SW. WriteLine ("<body>")
SW. WriteLine (" SW. WriteLine ("<font size=" "2" "face=" "Verdana" ">")
SW. WriteLine ("<table border=" "1" ">")
SW. WriteLine ("<tr bgcolor=" "#018FFF" "><td align=" "Center" "
<b>Command</b></td> <tdalign= "" Center "><b>Shortcut</b></td></tr>")
End Sub
Public Sub Writehtmlend (ByVal SW as System.IO.StreamWriter)
SW. WriteLine ("</table>")
SW. WriteLine ("</font>")
SW. WriteLine ("</body>")
SW. WriteLine (" End Sub
End Module

Listing 1: Macros that generate keyboard shortcuts in HTML files

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.