Поделиться через


How to: Customize Snippet Code Once It Is Inserted into Your Code

When you add a snippet to your code, the inserted snippet code has one or more replacement points highlighted in the code. You may or may not choose to change each replacement point. If you rest your mouse pointer over the replacement point, a ToolTip appears that explains how you need to change the code. The Code Editor recognizes a snippet as a unit separate from your surrounding code until you close the source-code file. As such, the replacement points remain highlighted until you have closed the source file.

To customize the inserted code for your application

  1. Use the TAB key to move from one replacement point to the next. Use SHIFT+TAB to move to a previous replacement point.

  2. Click CTRL+SPACE to invoke IntelliSense.

  3. Select an item from the list, or type a replacement of your choice.

  4. If you still have compiler errors in the code, then you may need to make other changes to your source code. For example, if the task is searching for a node in a TreeView control named TreeView1, then you may need to add a TreeView control named TreeView1 to your form.

See Also

Tasks

How to: Insert IntelliSense Code Snippets

Reference

Creating and Using IntelliSense Code Snippets

Concepts

Visual Basic IntelliSense Code Snippets

Security Considerations in Using Snippets

Best Practices for Using IntelliSense Code Snippets