Code snippet files are XML-files with "*.snippet" -extension. These files reside under C:\Program Files\Microsoft Visual Studio 8\VC#\Snippets\1033 for C# (for VB just replace VC# with VB).
There are two type of snippets; insert and surround with. Insert, as the name says, inserts desired code in the cursor location. In order to use Surround with, the appropriate code-section must be chosen. It surrounds the selected code with brackets, i.e. try{..} catch{Exception}.
There are two main ways to add a snippet in the code;
- From the menu "Edit - Intellisence - Insert Snippet" or with shortcut keys Ctrl + K (visual studio waits for second key combination) Ctrl + X
- From the menu "Edit - Intellisence - Surround with" or with shortcut keys Ctrl + K (visual studio waits for second key combination) Ctrl + S