Visual Basic .NET/Getting Started

To begin programming in Visual Basic .NET, you can either compile directly from the command line with the .NET SDK, use Microsoft's Visual Studio IDE, or the open-source SharpDevelop IDE.

In this manual, however, we will only be covering Microsoft's official IDE. Programming a form (window) by hand can be challenging if you are not familiar with the language, so starting with a good form designer will help a lot.

Okay, it's now time for your first program!

Application Windows Forms
Start up a Visual Basic .NET IDE and create a windows application.

Double click on the form to open up the code view. You should see something similar to:

Enter in the following code in the Form_Load Sub (between the "Private Sub" line and the "End Sub" line):

This creates your classic "Hello World!" program.

Press F5 or go to the Debug menu and select Start to start the program. You should see an alert box that says "Hello World!" and then the main window (with nothing on it) should open. Click the "X" in the title bar like you would to quit any program!

Application console
Add a new project via the menu File, then New, Project... and select Application console.

Paste in the Main function:

Now to avoid the program to automatically launch the previous paragraph form instead of the console, right click on the new ConsoleApplication1 from the Solutions explorer, and Set as starting project.

Then the console appears when pressing F5.

Basic symbols
As Visual Basic, VB.net uses:
 * 1) ' before comments
 * 2) _ to split a command on the next line
 * : to start a new command on the same line

Visual Basic .NET/Premier script