To use a code snippet, type its Shortcut Element (IntelliSense Code Snippets) and then press TAB two times. Snippets that have shortcut names appear in the Completion Lists in C#. Tap the UP and DOWN arrow keys in the Completion List to browse all available snippet shortcuts.
Snippets that do not have shortcut values must be used a different way. Press CTRL+K, X in the Code Editor to launch the Insert Snippet menu. Then, select a snippet from the menu and press TAB or ENTER. For more information, see How to: Use Code Snippets (C#) and How to: Use Surround-with Code Snippets.
Once a code snippet has been chosen, the text of the code snippet is inserted automatically at the cursor position. At this point, any editable fields in the code snippet are highlighted in yellow, and the first editable field is selected automatically. The currently selected field is boxed in red. For example, in the for code snippet, the editable fields are the initializer variable (i by default) and the length expression (length by default).
When a field is selected, users can type a new value for the field. Pressing TAB cycles through the editable fields of the code snippet; pressing SHIFT+TAB cycles through them in reverse order. Clicking a field places the cursor in the field, and double-clicking a field selects it. When a field is highlighted, a tooltip might be displayed, offering a description of the field.
Only the first instance of a given field is editable; when that field is highlighted, the other instances of that field are outlined. When you change the value of an editable field, that field is changed everywhere it is used in the code snippet.
Pressing ENTER or ESC cancels field editing and returns the Code Editor to normal.
The default colors for editable code snippet fields can be changed by modifying the Code Snippet Field setting in the Fonts and Colors pane of the Options dialog box. For more information, see How to: Change the Font Face, Size, and Colors Used in the Editor.