Udostępnij za pośrednictwem


Visual Basic IntelliSense Code Snippets

Visual Basic includes a code library consisting of several hundred pieces of code, called IntelliSense code snippets, that are ready to be inserted in your application. Each snippet performs a complete programming task such as creating a custom exception, sending an e-mail message, or drawing a circle. You can insert a snippet into your source code with a few mouse clicks. For more information, see How to: Insert Snippets Into Your Code (Visual Basic). You can also create your own snippets that suit your business needs, add them to the library, and then use them when needed. For more information, see Creating and Using IntelliSense Code Snippets.

A Productivity Tool for Visual Basic Users

These snippets increase your productivity by reducing the amount of time you spend looking for code samples, by reducing the time required to learn to use an unfamiliar feature, and by supporting the reuse of code.

The code library supports the following features:

  • Insert one of the snippets into the Code Editor.

  • Create new tasks that you can reuse in your projects.

  • Create new tasks to share with your workgroup and colleagues.

  • Edit the tasks.

  • Download more tasks from third parties.

These code blocks are available throughout Visual Studio:

  • You can add them through the shortcut menu of the Code Editor.

  • You can drag the XML code files from Windows Explorer onto your source-code file.

See Also

Tasks

How to: Modify Existing Snippets

How to: Share Snippets with other Developers

How to: Delete a Snippet Added to Your Code

How to: Assign a Shortcut Name to a Snippet

Troubleshooting Snippets

How to: Manage Code Snippets

How to: Search for Code Snippets Online

Concepts

Best Practices for Using IntelliSense Code Snippets

Security Considerations in Using Snippets