Implementing Derived Classes
The Class Designer is powerful enough to provide support for class inheritance. Suppose you want to create two classes deriving from Person
—for example, Contact
and Customer
. To create a Contact
class that inherits from Person
, follow these steps:
1. Right-click the designer surface and select the Add, Class command. When the New Class dialog box appears, specify the class name and leave the other properties unchanged.
2. When the new class is added to the designer’s surface, select Inheritance from the Toolbox and connect a line between the Person
class and the new class. This establishes an inheritance relationship between the two classes. You notice that the designer does not show inherited properties while it ...
Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.