Microsoft has released at least 9 different versions of Visual Basic.

Versions 1 to 6 were introduced from 1991 to 1998 and none of these versions are on sale any more, nor are they supported by Microsoft. However, the only version of VB installed in our school is VB6, one of the versions which is no longer supported. Programs written in VB6 are not compatible with current versions of Visual Basic.

Current versions of Visual Basic include Visual Basic 2010 Express Edition which IS free and which is part of a suite of free programs called the Express Editions suite. You should install and learn a current version unless you have been specifically asked to work with an older version. Try clicking HERE to download VB Express 2010. If the link is not valid then search the Microsoft site for Visual Basic Express.

There are hundreds of differences between VB6 and later versions such as VB Express 2010. The main advantages of VB Express 2010 are that it is current, free, fully OOP (object-oriented programming) and that it is part of a suite of programs (the Express suite) which are all free and which have family resemblances. But VB Express has many other advantages and also many disadvantages – I have tried to identify some of the differences that most strongly impact a course for beginners, and have listed them below:

VB Express has a much better code window interface:

  • indenting is automated
  • procedures can be collapsed (hidden)
  • errors are underlined and detailed in a window at the bottom of the screen
  • Errors such as writing procedures that refer to non-existent controls are identified
  • If you change the name of a control then code is automatically updated to match this.

A disadvantage of VB Express 2010 is that its code tends to be more verbose. This is especially obvious in lines beginning Private Sub which are now very long and cumbersome.

A major difference between VB6 and VB Express 2010 is that VB6 allows you to reference the default property of a control or object without specifying the name of the property. VB Express 2010 disallows this. In VB6 you could have:

   txtMyText = "Hello"

In VB Express 2010 the above statement must be replaced with:

   txtMyText.text = "Hello"

The properties left and top can be replaced now with location.x, location.y but I believe the properties left and top can still be used. In fact you can now also use the properties right and bottom which did not exist previously. Note that left can be set by code but x cannot.

The properties width and height are replaced now with size.width and size.height.

The caption property no longer exists – it is replaced by the text property.

The picture property is now called the Image property.

VB Express 2010 always measures distances in pixels, never in twips. The conversion is something like 1 pixel = 12 twips.

The command button is now called a button.

Option buttons are now called radio buttons.

The shape control is suppressed, but a rectangular shape can be obtained by making a label with no text.

The line control is suppressed.

Control arrays are suppressed.

The Image control is suppressed but the PictureBox control remains.

Run is now called Start Debugging.

Make EXE is now called Build.

A variant (a kind of general-purpose variable) is now called an object.

The Project Explorer is now called the Solution Explorer.

A .vbp file becomes an .sln (solution) file.

A .frm file is now a .vb file.

Dim myarray(5) creates an array with 5 elements numbered 0-4 whereas previously the same statement would give 6 elements numbered 0-5.

Option Explicit is on by default, whereas in VB6 it was off.

In VB Express 2010 there are tabs you can click to switch between code and design views.

The handling of colours changes so that, for example, text1.BackColor = vbred becomes text1.BackColor = Color.Red

More than 100 named colours are available whereas there used to be only eight.

The RGB format is replaced by a more verbose format and a new ARGB format is available which included Alpha (transparency).

The creation of menus is much easier in VB Express 2010 – menus can be edited in place.

Forms are now called Windows Forms and have rather different properties.

The Form_Load procedure is replaced by Sub_New.

The Timer control still exists, but setting its interval property to zero no longer disables the Timer. The timer control now appears under the form rather than on it.

The Timer control’s Timer event is replaced by a Tick event.

The Timer() function (not to be confused with the Timer control) is replaced by a VB.Timer() property. To use this property you must include the line Imports VB = Microsoft.VisualBasic at the top of your code.

When a messagebox is displayed other code (such as Timer procedures) keeps running whereas in VB6 the program paused awaiting a response.

The Date() function is replaced by the Today() function.

The Time() function is replaced by the TimeOfDay() function.

The Now() function is replaced by the TimeAndDate.Timer property.

The sqr() function becomes System.Math.Sqrt().

Sounds are better handled in VB Express 2010. For example, to play a WAV sound called ‘bang’ that has been imported into the project’s resource area the following code could be used:

Private Sub BlockClick(ByVal sender As Object, ByVal e As _ System.Windows.Forms.MouseEventArgs)

' Play the sound.


End Sub