VB.NET Tutorials, Source, and Help articles

With VB.NET we are able to create every type of application. From line of business and database applications to games that take full advantage of the the latest graphics technology, Visual Basic .NET can handle it all. Unlike its predecessors VB.NET is a full fledged object oriented language that gives developers access to not only a vast assortment of features but also the elegance and maintainability of the basic language syntax.

This site was created to provide a resource to aid people who are striving to become VB.NET experts. Whether you are a beginner just starting to learn the VB.NET basics or an advanced developer wanting to dive deeper into the .NET intricacies you should be able to find what you are looking for in our VB.NET tutorials, source code, and help articles. Browse around all the VB.NET articles on this site and if you don't find what you are looking for just suggest it.

Visual Basic Power Pack

Starting in 2005 Microsoft released a Power Pack which gives VB.NET access to many great components that VB6 users where used to such as: Shapes, DataReader, PrintForm, etc. This tutorial gives some examples of these controls and how you can make use of them when developing great Visual Basic .Net applications.

VB.NET Input Box

An often used feature in classic Visual Basic is the InputBox function. It provides an easy way to prompt the user for simple text input. VB.NET carries this handy function forward for all to use. Although you probably won’t use this any time you need to request a large or amount of data or in other complex scenarios, it does provide a simple and effective way to get input in your Visual Basic.NET apps.

Writing To Text Files

VB.NET provides multiple ways to save program data out to a file. This VB Tutorial will walk you through several different ways to easily save your data to a simple text file. This is by far the most straight forward way to serialize data so that your VB program can later read it back in. Below you will learn how to write to files using both a fixed format or a delaminated format. If you don’t know what this means or why you would choose one over the other please read on and it will make sense.

Reading Text Files

So you have a file full of text how can you parse and read it. This File Reading VB.NET tutorial explains exactly how. It goes over examples of fixed width files, tab and comma delimited files, and even how to use the .NET TextFieldParser class. After going through these examples you will be handling text files with the best of them.

Simple Windows API Example

The Windows API allows any program to have full access to all the inner workings of Windows. This is means as a developer we should be learning what all the Win32 API offers so that we aren't limited by the language or libraries we are using. This tutorial walks through a simple example of how to interact with Microsoft's Windows API.

Simple and advanced Conditional Experssions

Comparisons in programming allow us to do the most simple and powerful thing - make a choice. By using comparisons we can do things like branch in different directions if something is true, or loop over a bunch of things until a comparison is false, etc. This tutorial explains all the operations VB.NET supports when doing comparisons. This will provide a solid foundation for some of the more advanced features of Visual Basic .NET.

VB.NET Strings

VB.NET has amazing support for handling strings. This includes both the native .NET methods as well as the ones in Microsoft provided Microsoft.VisualBasic namespace (which makes migrating from VB6 over to VB.NET much easier). This tutorial goes through most of the string handling functions in in both these areas and compares them to each other.

From VB6 to VB.NET with the Microsoft.VisualBasic Namespace

For everyone coming from a VB6 background Microsoft has provided many great ways to migrate over to VB.NET. One stepping stone in this process is the Microsoft.VisualBasic namespace that they provided. This namespace allows VB6 programmers to start developing VB.NET apps quickly and comfortably. This tutorial gives a quick introduction to this namespace and how you can use it to start developing in VB.NET and then move onto the more “pure” .NET functions.

Button, Label, Textbox, Common Controls

Control Basics

The GUI aspects of VB.NET programming involves the use of the various controls that are available in the toolbox. With controls come properties (a set of variables that describe the appearance, behavior, and other aspects of the control), methods (procedures built into a control that tell the control how to do things), and events (actions that occur in your program). Properties, methods, and events common to most controls are described in the tables below.

Browse, Open, and Save Dialogs

Often when writing a VB.NET application we need to either open a file from the system or save a file to the system somewhere (many times both). Other times we need to browse for a folder instead of a file. Each one of these can be accomplished with a different Common Dialog that ships with VB.NET. To open a file we use the OpenFileDialog control. To save a file we use the SaveFileDialog control. Lastly, to browse for a folder we can use the FolderBrowserDialog.

SQL Databases Create, Update, and Query

One thing Visual Basic has always been good at is interacting with databases. VB.NET continues this great tradition. In fact this tutorial and source sample shows how you can create a SQL database, create a Table, create a Stored Procedure to populate the Table, , Create a View, and Execute the Stored Procedure to insert sample data. Lastly we will see how we can query the data using the View we created and store this into a DataSet and then display it in a DataGridView.

Before we start I recommend you download the source code sample and follow along:

Automatic Properties and List Initializers

Up until VB 2010 the only way you could declare a property is by creating a private backing field for it and then setting the property up so that it stored the value in the backing variable. This makes sense if you ware needing to do some sort of calculation or if a property was dependent on another property. However, most of the time all you wanted to do was expose a property so that consuming code could access it. Because of this you often saw the same boiler plate code over and over again.

Calling Windows APIs

I remember when I first learned how to call Win32 API’s using classic Visual Basic. It was like a whole new world of possibilities was opened up. Suddenly any VB limitations could be worked around by utilizing Microsoft’s built in API’s. I could change other programs windows and have my program show up in the task tray. Overall many of these limitations have been removed with VB.NET but whether its needing to call your own legacy code or wanting to once again interface with Windows, you will still find yourself as a VB developer needing to call into “old school” APIs.

VB.NET Console App That Reads an XML DataSet

This tutorial walks through a sample application that Microsoft provides where an XML file is loaded into memory and then can be queried using a console application written in VB.NET. Not only does this help us as we learn to write Visual Basic applications, it also allows us to see a simple example of what XML looks like, how it can be used like a database, and how the DotNet runtime can interact with it. We also get a demonstration of how to output data to the console, input data from the user, use if conditions, and while loops.

DateTime Functions

Visual Basic .NET provides a DateTime structure for working with, you guessed it, dates and times. Along with this structure there are many static and instance functions it provides. These functions allow us to do simple things from changing the time value to more complex things like displaying the Date or Time based on specific cultural settings. This tutorial dives into how these functions can be used in VB.NET application development.

Intro to VB.NET's DateTime

Often when working on an application we find ourselves needing to handle dates and times. Some common example uses of this are birthdates, appointment scheduling, expiration dates, timers, etc. Classic VB6 had some pretty good handling for Dates and Times, VB.NET takes it to a whole new level by giving us a good object oriented approach with the DateTime structure. In this tutorial we will get a good introduction to how we can handle dates and times in Visual Basic .NET.

VB.NET Arrays

Virtually any modern programming language has the concept of arrays. An array is like a list of variables. It allows us to work with the entire list or each individual element in the list. VB.NET’s support for arrays is similar to VB6’s although VB.NET’s object oriented capabilities makes it even easier for us to work with arrays. This tutorial walks through the basics of Visual Basic array handling.

Beginning VB.NET - Hello World

So you want to learn how to program in VB.NET. The best way to start learning is by jumping in. Follow the instructions on this page and within the next few minutes you will have your first Windows Application saying Hello to you. Its fun, easy, and very addicting as you being to learn the ins and outs of Visual Basic .NET.

Start by running Microsoft Visual Basic 2010 Express Edition (Or Visual Studio if you’ve purchased the full version). Do this by double clicking the desktop icon or through your Start Menu.

Syndicate content