Share via


Visual Basic Sample Applications

In the Visual Basic documentation, a sample is a Visual Basic project you can load into Visual Studio and run. An example is a small block of code that demonstrates a single, limited programming task. A snippet is a block of code that is inserted in the Code Editor using the IntelliSense Code Snippet feature.

To access samples from Visual Studio

  1. On the Help menu, click Samples.

  2. In the Samples on Disk section of the readme file, click local Samples folder. By default, the samples are installed in drive:\Program Files\Microsoft Visual Studio 10.0\Samples\1033 or drive:\Program Files (x86)\Microsoft Visual Studio 10.0\Samples\1033.

  3. Right-click the .zip file that contains the samples you want to open and then click Extract All to extract the samples to a folder of your choice.

For the most current samples, see the Visual Basic Samples Web site.

Security noteSecurity Note

Microsoft provides the included samples "AS IS" with no warranties. The code in the samples is provided just to illustrate concepts. The provided code may not meet security requirements for any specific environment. We recommend that you add security and error-handling code to your projects to make them as secure and robust as you deem appropriate.

The following table describes samples that demonstrate new features in Visual Studio 2010.

Sample

Description

Auto-Implemented Properties

Demonstrates how to define and use auto-implemented properties. For more information, see "Properties and Fields" in Object-Oriented Programming (C# and Visual Basic).

Collection Initializers Sample

Shows how you can use collection initializer syntax to create arrays and collections. For more information, see Collection Initializers Overview (Visual Basic).

Covariance Sample

Shows how to create and use covariant and contravariant interfaces. For more information, see Covariance and Contravariance (C# and Visual Basic).

Implicit Line-Continuation Sample

Demonstrates the advantages of the implicit line-continuation feature, which enables you to continue a statement on the next consecutive line without using the underscore character (_). For a list of syntax elements for which the line-continuation character can be omitted, see "Implicit Line Continuation" in Statements in Visual Basic.

Lambda Expressions Sample

Demonstrates how to use single-line and multi-line lambda expressions. For more information, see Lambda Expressions (Visual Basic).

In This Section

  • LINQ Samples
    Describes the Language-Integrated Query (LINQ) samples for Visual Basic, which are located in the VB Samples\Language Samples\LINQ Samples folder of the VBSamples.zip file.

See Also

Tasks

Visual C# Sample Applications

Concepts

Visual Basic IntelliSense Code Snippets

Visual Basic Coding Conventions

Other Resources

Visual Studio 2010 Samples

Visual Basic Programming Guide