How to: Create Inheritance Between Types (Class Designer)

Note

This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

To create an inheritance relationship between two types on a class diagram using Class Designer, connect the base type with its derived type or types. You can have an inheritance relationship between two classes, between a class and an interface, or between two interfaces.

To create an inheritance between types

  1. From your project in Solution Explorer, open a class diagram (.cd) file.

    If you don't have a class diagram, create it. See How to: Add Class Diagrams to Projects (Class Designer).

  2. In the Toolbox, under Class Designer, click Inheritance.

  3. On the class diagram, draw an inheritance line between the types that you want, starting from:

    • A derived class to the base class

    • An implementing class to the implemented interface

    • An extending interface to the extended interface

  4. Optionally, when you have a derived type from a generic type, click the inheritance line. In the Properties window, set the Type Arguments property to match the type that you want for the generic type.

    Note

    If a parent abstract class contains at least one abstract member, then all abstract members are implemented as non-abstract inheriting classes.

    Although you can visualize existing generic types, you can't create new generic types. You also can't change the type parameters for existing generic types.

See Also

Inheritance Inheritance Basics How to: View Inheritance Between Types (Class Designer) Visual C++ Classes in Class Designer