Every time you work on your system you need some shortcuts and that's why we have some basic ones like:
- Cut
- Copy
- Paste
But for the developer working on Visual Studio then he need some more shortcuts to increase their productivity so I will explain how to do the code easily and reduce your time to write the code.
Perhaps you know them but it's necessary for every developer to use them. That's why they are added to Visual Studio. Due to them Visual Studio is becoming a very powerful IDE for developers.
Here are some of them:
- Ctrl + K + D
- Shift + Alt + Up Arrow / Shift + Alt + Down Arrow
- Ctrl + M + O
- Ctrl + M + M
- Ctrl + K + C
- Ctrl + K + U
- Ctrl + F / Ctrl + H
To learn more in details, see the following.
Ctrl + K + D
This is my favorite shortcut and It's a very useful shortcut for "Formatting" either in a code file or .aspx file. For example when code is unformatted or is unstructured then just press "Ctrl + K + D" and see the magic.
Before "Ctrl + K + D" in the code file:
After pressing "Ctrl + K + D" in the code file:
Note: You can do the the Same in an .aspx file.
Shift + Alt + Up Arrow / Shift + Alt + Down Arrow
This shortcut is used when you have some continuous lines and they all have something in common, either in the code file or .aspx file like initials, now you want to change them with a single change using s replace all because it will replace that word in the entire page but you want to change some continue lines only like here.
Before "Shift + Alt + Up Arrow / Shift + Alt + Down Arrow". Now you want to change the "void" to "int" in all methods.
After "Shift + Alt + Up Arrow / Shift + Alt + Down Arrow":
This shortcut combines the cursors in a single cursor for all selected rows, that you can see in the preceding image as a vertical line after an int.
Note: You can do the Same in an .aspx file.
Ctrl + M + O
This shortcut collapses all the methods or classes in a single line or you can say it collapses each panel of code for the child and parent both. it will not work in an .aspx file.
Before "Ctrl + M + O":
After "Ctrl + M + O":
Note: You can't do this in an .aspx file.
Ctrl + M + M
This shortcut is used when you want to collapse the current span and you can also expand the current span. You can use this in a code file and .aspx file both.
Like here before "Ctrl + M + M":
After the first "Ctrl + M + M" when the cursor is in the A1() method:
After the second "Ctrl + M + M" when the cursor is in the A1() method:
Note: You can do this in .aspx file.
Ctrl + K + C
This is one of my favorite shortcuts that are used for commenting the selected code, either in the code file or .aspx file. The following are some key points of this shortcut.
- If you use it in a code file then it comments the code in a single line at once like '//'.

After the "Ctrl + K +C":
- If you use it in an .aspx file then it comments the code in multiple lines at once like '<%--'

After the "Ctrl + K +C":
Ctrl + K + U
It un-comments the selected code, either in a code file or .aspx file. The following are some key points of this shortcut.
- If you use it in a code file then it uncomments the code in a single line manner like "//'

After the "Ctrl + K +U":
Note: It doesn't work with multiple comments that are like "/* */".
- If you use it in an .aspx file then it comments the code in multiple lines at once like "<%--" .

After the "Ctrl + K +U":
Ctrl + F/ Ctrl + H
It is very common for a key combination used for a find and replace of any content in the file, but in Visual Studio you can use this in various variants like the following you can see:
"Ctrl + F" is only used to find the contents in the selected variant where as "Ctrl +H" is used for a find and replace of the content in the selected variant.
Note: It works in all kinds of files.
Conclusion: I hope they will be beneficial for you as a developer.

Pramod ThakurPosted Apr 8, 2015, 1:37 AM
tnx 4 sharing :)
vaibhav bhargavPosted Apr 6, 2015, 4:58 AM
cool..
Ashutosh PathakPosted Mar 31, 2015, 9:44 AM
Cool Tips
Vicky SiddharthPosted Mar 29, 2015, 3:20 AM
yes it will save my time ..
Tom MohanPosted Mar 24, 2015, 10:27 AM
Useful thanks for sharing
Pankaj Kumar ChoudharyPosted Mar 24, 2015, 10:02 AM
Thanks rahul Sir,really very helpfull and vital article..........
Hari ShankerPosted Mar 20, 2015, 1:38 PM
Thanx Rahul...Very Much Needed ShortCuts :)
Ravi PatelPosted Mar 20, 2015, 4:52 AM
great
DhanasekarPosted Mar 20, 2015, 2:35 AM
so helpful
Vikram ChaudharyPosted Mar 16, 2015, 5:22 AM
nice
Rahul BansalPosted Mar 14, 2015, 10:56 PM
Thank yoou guys to encourage me
Gowtham RajamanickamPosted Mar 14, 2015, 4:42 AM
Good...
Rajeev RanjanPosted Mar 13, 2015, 6:24 AM
everyday i wish someone tell me some short cut tricks in VS, thnz from bottom of my heart. your article teach me alot.
sachith wickramaarachchiPosted Mar 12, 2015, 4:33 AM
useful :D
Ekona PikinPosted Mar 11, 2015, 10:35 AM
awesome :)
Krishna Rajput SinghPosted Mar 10, 2015, 1:52 AM
really helpful rahul bro
Tom MohanPosted Mar 10, 2015, 1:15 AM
Helpful
Khargesh RajputPosted Mar 10, 2015, 12:16 AM
helpful sortkeys
Sam HobbsPosted Mar 10, 2015, 12:11 AM
I know there is very much we can do with shortcuts but I guess what I do is to create a custom toolbar and fill it with icons for the commands I use often. Sometimes it takes time to learn how to get some specific commands. The shortcuts I use most often are the function keys.