RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX


What's New in Visual Basic 9.0? Part 2 : Page 4

The release of Visual Studio 2008 updates Visual Basic to version 9.0, with several key language enhancements and LINQ support. Part Two of this series will walk you through VB 9's new LINQ support features and other time-saving enhancements.

Helpful IntelliSense
The IntelliSense support in Visual Studio 2008 has some additional features that make VB development much more productive and efficient. The following are some of the additions.

Automatic Properties
In Visual Studio 2005, when you type a property statement within a class definition and then press Enter, it automatically created the Get and Set blocks (see Figure 2).

Figure 2. The VS 2005 Method: Typing a property statement within a class definition and then pressing Enter automatically created the Get and Set blocks.
Figure 3. The VS 2008 Method: Typing the word "prop" and pressing the Tab key twice auto-creates the property definition.

However, you still needed to fill in the blanks so that the property value can be assigned to an internal private variable, for example.

Conversely, in Visual Studio 2008, this step is done for you automatically. To define a property, all you need to do is to type the word "prop" and then press the Tab key twice in succession (see Figure 3).

Figure 4. View the Connection Details: Change the names in green to what you need.
Figure 5. Syntax Help: IntelliSense shows the various parameters for those commonly-used constructs.

Visual Studio 2008 creates the Get and Set blocks, complete with the placeholders for the property name and the internal private variable. All you need to do is to change the name in green to whatever you want and it will update all the other relevant variables (see Figure 4).

More Helpful IntelliSense
IntelliSense is now more helpful with syntax for commonly-used constructs, as Figure 5 shows.

Figure 6. UI Shortcut: IntelliSense hides the list of available options when you push Ctrl.
Figure 7. The View: The Object Browser shows the list of members in a type.

Another very useful improvement to IntelliSense is auto-hiding. Figure 6 shows IntelliSense displaying a list of available options. However, many times you would need to refer to the code hidden by the list. In Visual Studio 2008, you can press Ctrl and the list becomes transparent. Once you release Ctrl key, the list comes back on.

Go to Type Definition
In Visual Studio 2005, you can right click on a variable and select Go to Definition to view the declaration for a variable. Visual Studio 2008 goes a step further by allowing you to view the type's definition. This is very useful, as it brings up the Object Browser and shows you the members of the type (see Figure 7).

One Step Further
I hope that this list of new features in VB 9.0 has helped you to better understand the new power of Visual Basic. Be sure to download the trial edition of Visual Studio 2008 (or download the various free Expression editions) if you have yet to experience the power of all these language extensions.

Wei-Meng Lee is a Microsoft MVP and founder of Developer Learning Solutions, a technology company specializing in hands-on training on the latest Microsoft technologies. He is an established developer and trainer specializing in .NET and wireless technologies. Wei-Meng speaks regularly at international conferences and has authored and coauthored numerous books on .NET, XML, and wireless technologies. He writes extensively on topics ranging from .NET to Mac OS X. He is also the author of the .NET Compact Framework Pocket Guide, ASP.NET 2.0: A Developer's Notebook (both from O'Reilly Media, Inc.), and Programming Sudoku (Apress). Here is Wei-Meng's blog.
Email AuthorEmail Author
Close Icon
Thanks for your registration, follow us on our social networks to keep up-to-date