Delen via


How to: Add Class Diagrams to Projects (Class Designer)

To design, edit, and refactor classes and other types, add a class diagram to your Visual C# .NET, Visual Basic .NET, or C++ project. To visualize different parts of the code in a project, add multiple class diagrams to the project.

You can't create class diagrams from projects that share code across multiple apps. To create UML class diagrams, see Create UML Modeling Projects and Diagrams.

To add a blank class diagram to a project

  1. In Solution Explorer, right-click the project name. Then choose Add New Item or Add, New Item.

  2. Under Templates, choose Class Diagram. For Visual C++ projects, look under Templates, and then under Utility to find this template.

    The class diagram opens in Class Designer and appears as a file that has a .cd extension in Solution Explorer in the project hierarchy. Use the Class Designer toolbox to drag shapes and lines to the diagram.

  3. To add multiple class diagrams, repeat the steps in this procedure.

To add a class diagram based on existing types

  • In Solution Explorer, open the class file context menu, then choose View Class Diagram.

    -or-

    In Class View, open the namespace or type context menu, then choose Class Diagram.

See Also

Tasks

How to: Create Types by using Class Designer

How to: View Existing Types (Class Designer)

Other Resources

Designing Classes and Types (Class Designer)

Viewing Types and Relationships (Class Designer)

Working with Class Diagrams (Class Designer)