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.
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.
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.
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.
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.
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.
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.
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:
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.
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.
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.
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.
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.
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.
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.