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 arereplaced 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 2008 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 2008 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 2008 – 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 2008. 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.
My.Computer.Audio.Play(My.Resources.Bang,AudioPlayMode.Background)
End
Sub