You do get a great Integrated Development Environment (IDE)
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------
The same SnapLines that make creating forms ... well, "a snap". The same window docking diamonds so you can easily customize your environment. The same improved Intellisense. In short, all the really good stuff. Where it counts for most of us, it's just like the expensive version. At this point, many tutorials go into great detail about these features, but there's no way I can outdo Microsoft in beating the drum for VB Express, so I recommend that you just read about these features on the Microsoft page.
Although we go into much more detail on what the Framework is in the next segment, here's a quick run-down on new improvements in VB.NET.
Although VB.NET is fully compatible and interoperable with other .NET languages, there are some things that you only get with Visual Basic. One that was introduced with VB.NET 2005 is the My Namespace.
The "My" Namespace
A general definition for namespace that I like is "The set of names accessible at a given point in a program." The concept of a "namespace" is used in a lot of other software technologies (especially XML where it's a core concept). Microsoft defines "namespace" for Visual Basic programs this way:
Namespaces organize the objects defined in an assembly. Assemblies can contain multiple namespaces, which can in turn contain other namespaces. Namespaces prevent ambiguity and simplify references when using large groups of objects such as class libraries.
But definitions like this are hard to understand. "Namespace" is something that is easier to understand with examples. Consider these examples using the My namespace in VB Express.
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------
Using the Ports property from the illustration: My.Computer.Ports
This name references the Ports property in the Computer class in the My namespace. The reason namespaces are important is that they allow you to use common descriptive names without having to worry about whether the same name is used somewhere else. In other words, "Ports" might be a name that someone would choose for a variable in their program code too. But when you qualify it with a namespace, you tell the program which "Ports" object should be used:
Dim a As Object
a = My.Computer.Ports
Dim Ports As Object
Ports = "123456"
The My namespace doesn't actually provide completely new capability to your program. You could get the same information in previous versions and in other languages. Before this feature was released, I wrote an article showing one way to do it. But the My namespace gives you access to properties and methods in seven groups of software objects more quickly and easily than was possible before. These groups of objects are:
- My.Application
- My.Computer
- My.Forms
- My.Resources.Culture
- My.Resources.ResourceManager
- My.Settings
- My.User
- My.WebServices
To give you a quick example showing how the My namespace can help you create systems faster, we're also going to use another feature of VB Express: pre-coded functions provided by Microsoft in VB Express. In this case we're going to add a splash screen - a form that displays to give the user something to look at while the application is loading. A splash screen gives a nice finishing touch to systems, but programming them can be a tedious chore. After we add the splash screen, however, we'll use the My namespace for quick and easy access to the splash screen.
First, to add a splashscreen to your project, all you have to do is get the code from VB Express. The illustration below shows you how to find it. To try this out, start a new project using the Windows Application template and add a splashscreen to your project. Notice that the program code for the complete splashscreen is automatically added to the project. If you're interested in how it's done, you can browse the code and see!
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------
In addition to adding the splashscreen, you also have to tell VB Express to use this code. To do this, select Project > Properties. Then select the Application tab. Look for the "Splashscreen" selection near the bottom. Select the splashscreen you added to the project from the dropdown list. This is all it takes to create a working splashscreen with default images and data. Click the Run button in the toolbar and try it!
In general, settings in the My namespace are either application-scoped or user-scoped. The Ports setting above is a good example of a user-scoped setting. Application-scoped settings are program information that you don't normally change, so they're declared as ReadOnly in .NET.
To change the title of an application, select the <application name> Properties under the Project menu (or right-click the Project in Solution Explorer) and click the Assembly Information button on the Application tab. The title of the application is then available to any other part of your project in the My namespace:
MsgBox("Application " & My.Application.Info.Title & " is running!")
In only a few minutes, I was able to create this custom "About Visual Basic" splash screen:
--------
Click Here to display the illustration
Click the Back button on your browser to return
--------
On the next page, we look at a new feature in VB Expess that a lot of people think is the most significant advance added recently: Generics.

