Visual Basic Application Samples

These samples demonstrate architecture, project, user, and assembly tasks.

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, go to 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.




Application Events Sample

Demonstrates how to use My.Computer.Network events to write network-aware applications and how to access application events through the Project Designer.

ClickOnce Sample

Demonstrates how the ClickOnce feature can be used to programmatically handle several installation and maintenance tasks, such as checking for new updates, downloading the updated application, and retrieving and reporting the application name, version, location, and last update check.

Console Application Sample

Demonstrates simple input and output using the console window.

Environment Information Sample

Demonstrates the use of several classes that provide environment information.

Excel Sample

Demonstrates how to use Visual Basic to start Excel, create a workbook from a template, and update cells in a worksheet that then populates graphs in the workbook. Also shows how to send the workbook to an e-mail address, either one time or on a regular schedule.

Game Sample

Implements a simple Windows Forms game, complete with GDI+ graphics, timer features, user configuration, and high-score storage.

Logging Sample

Uses the My.Application.Log object to write to a plain text file, the event log, and an XML file.

Multithreading Sample

Demonstrates how to use multiple threads to achieve concurrency in tasks.

My.Resources Sample

Demonstrates how to manage resources and settings for an application by using the My.Settings object, the My.Resources object, the Project Designer, and the Resource Editor.

PowerPoint Sample

Demonstrates how to start PowerPoint, create a blank presentation, add a slide and content, print slides, save your changes, and exit PowerPoint from within a Visual Basic application.

PrintForm Sample

Demonstrates use of the Print Preview Functionality.

Send Mail Sample

Shows how to send email over SMTP using classes in the System.Web.Mail namespace.

TCP Remoting Sample

Shows how to use the .NET Framework remoting architecture. It uses XML configuration files to specify available objects and server location information.

Threaded User Interface Update Sample

Shows how to update the user interface when data is supplied from a different thread.

User Information Sample

Provides an overview of the My.User object and the Login Form template. It implements a simple custom authentication.

Visual Basic 6.0 Upgrade Sample

Shows an application in Visual Basic 6.0 and how that application might be upgraded to Visual Basic 2010.

See Also


My Reference (Visual Basic)

Other Resources

Visual Studio 2010 Samples

Visual Basic Sample Applications