- Working in Full Screen Mode in Visual Studio
- Alt+Shift+Enter is the shortcut to enter to fullscreen mode in Visual Studio
- Its sometimes really helpful and more appealing for developers to work in full screen mode
- Editing
- For Copying a line in the IDE just go to the start of the line and press Ctrl+C,there is no need to select anything
- For Pasting a line just go to the start of the line and just press Ctrl+V
- For Deleting a line just go to the start of the line and press Ctrl+X, this is not actually delete but its similar to cut if you do Ctrl+X on current line and go to some other place in your code and do Ctrl+V then it will paste the same line there.
-
- Expanding and Collapsing the code units
- This nice little shortcuts has saved me a lot of time.Whenever i am working on a large piece of code i always get confused and make some changes in other Method or property because they were looking similar.
- But now with this shortcut i collapse one method as soon as it is finished.
- The shortcut is Ctrl+M+M.
- Just go to the beginning or end of the method or property or any code block and hit the shortcut it will expand or collapse the code block comparing to its present state.
- If you want to collapse all your code units or blocks to their definitions then the shortcut to achieve this is Ctrk+M+O or Ctrl+M Ctrl+O.This is also a very handy shortcut which helps a lot in development.
- Automatic Text Indentation and Formatting
- This shortcut helps me to write beautiful and decorative code which is easy to understand by any person.
- Shortcut is just press Ctrl+K+D.
- This works not only in C# and VB code behind but it works well in aspx pages.
- If you want to just format the selected piece of code then just press Ctrl+K+F
- Automatically adding Namespaces
- Use the Ctrl+. (Remember this is Ctrl+[period] if you get confused) shortcut key to automatically get intellisense for probable namespaces.
- Just press enter to include the required namespace.
- There are much cooler tricks when using a refactor like Resharper.I will discuss those tricks later this month in one of my posts.
- Commenting And Uncommenting The Code
- This trick saved me a lot of time.
- Just select the code to be commented and press Ctrl+K+C,this will comment your code block.
- For uncommenting the code just press Ctrl+K+U,this will uncomment the code block.
- Automatically generating properties
- Generating dummy getter and setters or properties is also a pain in big projects.
- Although i would recommend you some refactors like Resharper which can do it for you or some code generators like Code Smith and also give a try to inbuilt on in Visual Studio 2008 called T4 or Text Template Transformation Toolkit.
- But if you don’t have such a mass volume project and just don’t want to write your getter and setters then just type this prop + TAB+TAB
- Remember you don’t have to type all of this but you only type prop and then press TAB two times for VS2008 to automatically generate the property for you now you can change the name and any other thing by navigating and just pressing TABS.
- Increasing and decreasing the indentation
- Select the code block for which you want to increase the indentation and after selecting just press TAB,this will increase the indentation.
- To decrease the indentation just select the required code block and then press SHIFT + TAB,this will decrease the indentation of the selected code block.
- Selecting a single word then line and then other lines within that block and then…….
- This is also a cool trick if you are in middle of something and want to do something on either the word you are on or the entire code block, or entire method, or entire class then just go on pressing Ctrl+W,it will start selecting for you starting from the current word.
- After selecting the desired code block you can perform any operation on that code block.
- Build & Debug Shortcuts and tricks
- To build a solution just press Ctrl+Shift+B
- To start debugging just press F5
- To stop debugging just press Shift+F5
- If you are already debugging or your WebDev.WebServer.Exe is running or any other webserver is running you can directly attach to that process escaping the hussle to build again this is a great time saver.Remember always build or rebuild if you have done some major changes but if simply you want to debug and have done no changes in any other class library projects then you can use this trick
- Simply Press Alt+D+P then the Attach to process window will open.
- Simply choose your web server process to attach and you will see without building your entire solution your solution has been attached to the debugger.
- Find Options
- You are already familiar with Ctrl+F option to find something either in current documents or all open documents or entire project or entire solution,but another find option is Ctrl+Shift+F, this trick is helpful when you want all your results to be listed in a find window rather then to navigate one by one in every file where the searched string exists.
- Switching Between Design And Source Views
- F7 is the key used to switch between design and source (ie c# or vb files) views in IDE
- If you want to just toggle the markup’s design and source view or want to view both then press Ctrl+PageDown
- Some other common used shortcut keys which can be helpful
- Ctrl+Alt+L for opening Solution Explorer
- F4 for opening properties window
- Ctrl+Alt+X for showing the toolbox
- Ctrl++T for displaying the tasklist
- Ctrl++E for displaying the error list
- How to navigate between various opened tabs inside Visual Studio
- Ctrl+TAB key will let you navigate between various open tabs in Visual Studio IDE
- Going to Declaration and then again returning to the actual usage
- Just press F12 to go to declaration
- And press Ctrl+- to return back to the piece of code where you were earlier.
- Selecting Source Control Plugin
- If you are working in a team you probably will be using a source control there are many options to choose SVN,Visual SVN,TeamFoundationServer,Source Vault and Source Fortress and many others.
- But when selecting a client you have to mention it in Source Cotrol Plugin Selection as shown below
- I want solution for every project which i create
- If you want a solution for every project which you create then you have to enable this as shown below

I would have really forgotten many things which could be added in this list.I will update this list regularly as I encounter any new thing,so stay tuned for more Also I would be doing an extensive post on Resharper 4.0,the most sharpest refactoring tool available out there its not just a refactor but a way beyond that Believe me i use it in my day to day coding and it makes development process 100K faster. Happy Programming!!!! Update 12Dec2008
- For deleting a line in Visual Studio just place the cursor in front of it and press Ctrl+Shift+L
Update 4 Jan 2009
1.This post links to a tip used to decrease the load time of the IDE by disabling the splash screen. https://www.smallworkarounds.com/index.php/2009/01/04/visual-studio-tips-tricks-2-decrease/ “If someone wants to purchase Visual Studio 2008 at a discounted price, you can purchase at a low price from eCostSoftware.”
Hi
I knew some of them but the list is more complete now.
thanks
Dragosh
The quality of those images is just awful. Use PNG instead of JPG for this kind of thing.
Most of those points are indeed valid, but the IDE’s shortcut system for text editing is rather dire. It’s a poor effort at the likes of VIM and emacs. I hope in future releases of VS that they build some proper editing facilities (such as VIM emulation) directly into the core.
Having said that, the likes of ViEmu make this problem go away 🙂
Great list!
One tip for you: Please use PNG-files next time you post a story. Much nicer screenshots 🙂
Nice post, but please use PNG for your screenshots in the future.
These features work in VS2005 too.
@all
Yes i will definately switch to png’s next time i was just experimenting with google picasa web albums and they use jpegs in order to reduce the size of these i messed with the quality but listening to all your suggestions i will definately use png’s and some other hosting service.
Thanks to all of you for your valuable suggestions
Re: Most of those points are indeed valid, but the IDE’s shortcut system for text editing is rather dire.
The Visual Studio IDE supports full remapping of the keyboard and has a complete macro system. I haven’t found anything yet that I cannot do, and my VS environment is highly keyboard-automated. Between Intellisense and macros, I rarely have to press more than a few keys to get anything done.
Visual Studio may not be exactly what you need out-of-the-box, but you can conform it to your exact needs with just a little work. It’s worth the effort if you spend all day in the IDE like I do.
Just to note that if you press ctrl+c or ctrl+x at any part of a line it copies/cuts the entire line. Doesn’t have to be at the begining.
great tips keep posting 🙂
@Peter
Hey Peter thanks for reminding that it was my mistake while writing.
@Ajay
Thanks Ajay for your valuable comment.Ya for sure i will keep on posting and there are yet many posts to come.
Thanks again!!!!
thanks for sharing it.
This is very help full article for new user and other who do not know all shortcut related to dot net.
Thanks for sharing knowledge.
Thanks
Shakti Singh Dulawat
http://www.nextmvp.blogspot.com/
for full screen mode shortcut is Ctrl+ Alt+Enter not Ctrl+Shift+Enter.
By the way good copy 😀
@Anonymous
>>"for full screen mode shortcut is Ctrl+ >>Alt+Enter not Ctrl+Shift+Enter.
>>By the way good copy :D"
Hey man i have written Alt+Shift+Enter for the full screen mode and it perfectly works fine for me.
Once recheck the post.
Anyways thanks for comment.
very useful tips, thanks for posting
Hi Aashish
Few more shortcuts , if u would like to add in your list
Shift-F7 –Switches from the code view to the design view in the editor
Ctrl-Shift-1 –Navigates to the definition of any method (show definition)
F9 –Sets or removes a breakpoint at the current line
Ctrl-F9 –Enables or disables the breakpoint
F11 –Executes code one statement at a time
F10 –Executes the next line of code but does not go into any function calls
c-sharpdotnetfreak.blogspot.com
Nice work, buddy.
I’s looking for this:- “Expanding and Collapsing the code units”.
It helped me a lot.
Thankz.
Take care.
@HNF,Shakti,Amit,Abhilash
Thanks for the comment.
@Amit
Thanks for suggesting those i am doing another post on these shortcuts and tricks i will definately include them there.
While writing this post i thought of putting only those shortcuts which are not so commonly used but can be a great time saver.But now in my other post i will publish simple but useful shortcuts also which will include all.
Thanks for the share.
Good tips in this. Just wanted to add that another way to quickly create a property is to make the private field variable like:
int _test; //leave cursor after the semi-colon
Now, hit CTL-R-E
A window will come up to confirm the auto-generated public name… confirm, and the system generates the get/sets for you.
You can really bang out properties quickly with this shortcut.
Very useful shortcuts. good work
Thanks
RainManALex
Great post. (For balance, I will add a counter-point to OJ’s comments above by suggesting that what the Visual Studio IDE Development Team should do is move as far away as possible from Vi, emacs, and similar arcane command-line paradigms, as quickly as possible. Abacus. Ug. Emulate Vi? What’s next? Use Papyrus? An Abacus? A Quill? LOL.) — Mark Kamoski
Excellent man,great this helped me a lot
Thank u
Good Amit
Thanks
really nice post. this helped me a lot.
very nice article
nice article really
Very handy, thanks.
good work 🙂
—
Umer
Thanks for that, good work..
Auto creating properties. With VS2008 shortcuts …
type the variable name eg private string _foo.
Hit ctrl R, ctrl E . This will generate the property for u.
Thanks a lot,very helpful
Thanks this is a nice list. Just wanted to Add to point number 3 above.
Ctrl + M + P : Expands all outlining. Basically reverse of (Ctrl + M + M).
Very useful short cut wonder where you found this one
Cheers
Anup
The tricks are handy but way of presenting them can be a further refined.
Aashish,
Excellent finding!!!
I was looking for Line copy & paste, expand & collapse.
Thank You,
Anjum Rizwi
Thanks. Very Helpful.
A.Srinivasan
CTRL+M+O = Awesome!! Cheers for that!
Awesome .. Cheat sheet for these shortcuts?
Thanks u r information
ctrl+spacebar opens inteli sense anywhere in code
Great Post … I have a question .. with CTRL-+K+D to reformat code …. is there any way to contro HOW VS formats the code (CSS, etc.) … I prefer single line .Styles but VS insists on multi-line
when using ctrl+shift+f, it's handy to use f8/shift+f8 to iterate through results back and forth.
For deleting a line in Visual Studio just place the cursor on it and press Ctrl+Shift+L (OR)Shift + del.
Thanks for the tip,, really good one
Nice one
Hi Amit,
This is the very nice tips
You can also one more tip in the list
This is for Text selection
Shift + Alt + (Arrow keys )
nice Works
thanks for Informations
Great. I am sure, I will tweet this to my twitter account. This will help a lot of users.
gud one