
Changes to Programming Elements | 699
What’s New
2002
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
color constants vbRed and vbBlue, are no longer directly supported. The color
constants are part of the System.Drawing namespace’s Color structure and are
accessed as follows:
Me.BackColor = System.Drawing.Color.BlanchedAlmond
When using most constants, other than those in the Microsoft.VisualBasic.
Constants class, you will need to include some or all of their namespace and class
name prefix. For example, the
vbYes constant in VB 6 continues to exist in VB.NET
as a member of the
MsgBoxResult enumeration. It can be used as follows:
If (MsgBoxResult.Yes = MsgBox("OK to proceed?", ...
For a list of built-in constants and enumerations, see Appendix C.
String Functions
The String function has been removed from VB.NET. Its functionality now
appears as part of the
String data-type constructor.
Dim giveThemAnA As New String("A"c, 5)
which defines a string containing five As. The c modifier in "A"c indicates a char-
acter literal (data type
Char) as opposed to a standard one-character string (data
type
String).
Emptiness
In VB 6, the Empty keyword indicated an uninitialized variable, and the Null
keyword was used when a variable contained no valid data. VB.NET does not
support either keyword but uses the
Nothing keyword in both of these cases. The
Null ...