48Microsoft Visual Studio 2010: A Beginner’s Guide
Figure 2-8 Filling in the Snippet template
You can identify snippets in the completion list by the torn paper icon. At this point, you can press the TAB key to complete the namespace keyword. Then press TAB again to produce a template where you can fill out the highlighted fields. Figure
As shown in Figure
VB offers a couple of ways to add snippets: by typing prefixes or via a pick list. To see how VB snippets work, place your carat inside of the Module1 module, underneath End Main (not inside of the Main block). Type Su and press TAB, and notice that VS creates a Sub (method) along with a template containing a field for filling out the Sub snippet.
Another way to add VB snippets is to type a ? and press TAB. You’ll receive a pick list, as shown in Figure
Now that you know how to use snippets, let’s move on to the different types of statements you can have in C# and VB and how snippets work with those statements.