Code Snippets are one of the coolest features of Visual Studio, which can help us to increase our coding speed multifold. Good developers generally use shortcuts and tricks to type fewer characters and generate more code in less time.
Code snippets are ready-made snippets of code which we can quickly insert into your source code. They are a great productivity boost & can make writing program code quicker, easier, and more reliable.
In Visual Studio IDE, we can bring up the code snippet menu in 3 different ways –
- Press CTRL+K, CTRL+X and select the required snippet.Press TAB, TAB to invoke the code snippet.

- Press CTRL K + CTRL B to bring up the Code Snippets Manager, where we can see all the code snippets and manage them.
- Press CTRL+SPACE to view the completion list and then select the snippet shortcut from the list. Press TAB, TAB to invoke the code snippet.
Below are justa handful of code snippets which we can use in our day-to-day development work:
Shortcuts Description ctor Creates a constructor for the class prop Creates an auto-implemented property declaration. propfull Creates a property declaration with get and set accessors. try Creates a try-catch block. switch Creates a switch block. foreach Creates a foreach loop.


Vipin TyagiPosted Mar 9, 2016, 8:18 PM EST
Helpful. Also, I want to mention that if you previously know your snippet than type some character and hit Tab key twice instantly.This will display your whole snippet in the editor.
Samir BeharaPosted Feb 20, 2016, 4:13 AM EST
Thanks
Former memberPosted Feb 19, 2016, 8:56 PM EST
good one.
Jyotirmayee BeharaPosted Feb 10, 2016, 5:44 PM EST
This is a really useful tip for any developer.
Abhishek KumarPosted Feb 8, 2016, 9:31 PM EST
Nice info..
Jaipal ReddyPosted Feb 8, 2016, 6:39 PM EST
Nice
Ehsan SajjadPosted Feb 8, 2016, 3:02 AM EST
Good tips
Mr ShanawarPosted Feb 7, 2016, 1:37 AM EST
good artical, helpfull
Ajeet MishraPosted Feb 4, 2016, 8:44 PM EST
very nice
Samir BeharaPosted Jan 27, 2016, 4:35 PM EST
Here is the link to my personal blog - http://dotnetvibes.com/
Samir BeharaPosted Jan 26, 2016, 7:27 PM EST
Thanks all for your feedback.
Ankur MistryTOP 100Posted Jan 25, 2016, 5:29 PM EST
Nice share
Vignesh ManiTOP 100Posted Jan 24, 2016, 11:53 PM EST
Nice One
Santhakumar MunuswamyPosted Jan 24, 2016, 5:57 AM EST
Thanks for nice share
Ehsan SajjadPosted Jan 24, 2016, 2:04 AM EST
useful info
Gowtham KTOP 100Posted Jan 24, 2016, 1:22 AM EST
Thanks for sharing:)
Nigel FernandesPosted Jan 23, 2016, 9:45 PM EST
Useful!
Shashangka ShekharPosted Jan 23, 2016, 6:21 AM EST
Thanks for sharing
Sthitaprajnya Debasis NayakPosted Jan 23, 2016, 5:45 AM EST
Nice One
Hemant MahajanPosted Jan 23, 2016, 4:25 AM EST
Cool!
Muhammad Aqib ShehzadPosted Jan 23, 2016, 1:54 AM EST
Code snippet is a very nice feature and lot of other hidden things to explore in the environment. Thanks for nice info.