Microsoft Visual Basic 2005 Step by Step (Step by Step (Microsoft))

Chapter 16

Inheriting Forms and Creating Base Classes

After completing this chapter, you will be able to:

An important skill for virtually all professional software developers today is the ability to understand and utilize object-oriented programming (OOP) techniques. Although Microsoft Visual Basic 6 offers several object-oriented programming features, experts say that it lags behind the “true” OOP languages, such as Microsoft Visual C++, because it lacks inheritance, a mechanism that allows one class to acquire the interface and behavior characteristics of another class.

Beginning with Microsoft Visual Basic .NET 2002, the Visual Basic language and IDE have supported inheritance, which means that you can build one form in the development environment and pass its characteristics and functionality on to other forms. In addition, you can build your own classes and inherit properties, methods, and events from them.

In this chapter, you'll experiment with both types of inheritance. You'll learn how to integrate existing forms into your projects by using the Inheritance Picker dialog box that is part of Microsoft Visual Studio 2005, and you'll learn how to create your own classes and derive new ones from them by using the Inherits statement. With these skills, you'll be able to utilize many of the forms and coding routines you've already developed, making Visual Basic programming a faster and more flexible endeavor. These improvements will help you design compelling user interfaces rapidly and will extend the work that you have done in other programming projects.

Upgrade Notes: Migrating Visual Basic 6 Code to Visual Basic 2005

If you're experienced with Visual Basic 6, you'll notice some new features in Microsoft Visual Basic 2005, including the following:

Категории