Visual Basic Windows Forms Samples
These samples demonstrate common tasks for Windows Forms applications.
To access samples from Visual Studio
On the Help menu, click Samples.
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.
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.
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.
Demonstrates how to copy and retrieve Clipboard items in multiple formats.
Common Dialog Box Components Sample
Custom Drawing User Control Sample
Demonstrates how to create custom-drawn user controls, use them on a form, enable them to respond to events, and define properties for use in Design view.
Demonstrates drag-and-drop functionality with text, images, and tree-view nodes.
Dynamic Control Creation Sample
Demonstrates how to add controls to a form in a Windows Forms application at run time.
Explorer-Style Application Sample
Contains two forms that have split-pane windows, similar to Windows Explorer.
GDI + Animation Sample
Demonstrates how to implement animation, such as moving text, a bouncing ball, and an animated image, by using the System.Drawing namespace objects.
GDI+ Brushes Sample
Demonstrates how to customize a brush by using the Brush object.
GDI+ Images Sample
Demonstrates the manipulation of images. Manipulations include zooming, resizing, rotating, and clipping.
GDI+ Pen Sample
Demonstrates how to customize a pen by using the Pen object.
GDI+ Text Sample
Shows the effects of text options. Text options include shadow, embossing, block text, shearing, and reflection.
Help Files Sample
ListBox and ComboBox Sample
Demonstrates how to use MenuStrip controls in Windows Forms applications to create menus at runtime and handle menu events.
Demonstrates how to use the My.Printers object to print text and configure a printer.
Regular Expressions Sample
Demonstrates how to validate user input by using the Regex class, which represents regular expressions.
StatusStrip Control Sample
Demonstrates how to display various types of data visually in the StatusStrip control.
Text Validation Sample
Top-Level Forms Sample
Demonstrates how to implement an application that supports multiple windows that appear separately in the taskbar.
Visual Inheritance Sample
Shows how you can use inheritance with Windows Forms.
Web Browser Sample
Demonstrates how to create a simple Web browser by using the WebBrowser control.