Condividi tramite


How to: Add Classes and Subclasses to Class Libraries

When you create a class or subclass interactively or programmatically, the class is stored in the class library that you specify. If the class library exists, the class is added to the class library.

To add a class to a class library

  1. Open the class library in the Class Browser.

    For more information about opening class libraries, see How to: Open Class Libraries.

  2. In the class list of the Class Browser, select the class library you want to add a class for.

  3. In the Class Browser, click the New Class button.

    The New Class dialog box opens so you can specify information for the new class.

  4. Follow the steps for creating a class or subclass. For more information, see How to: Create Classes and Subclasses.

When you finish creating and saving the class, the class appears in the class library displayed in the Class Browser.

To add a subclass to a class library

  1. Open the class library in the Class Browser.

    For more information about opening class libraries, see How to: Open Class Libraries.

  2. In the class list of the Class Browser, select the class you want to create a subclass from.

  3. In the Class Browser, click the New Class button.

    The New Class dialog box opens so you can specify information for the new class. The class you selected appears by default in the Based On box.

  4. Follow the steps for creating a class or subclass. For more information, see How to: Create Classes and Subclasses.

When you finish creating and saving the subclass, the subclass appears in the class library displayed in the Class Browser.

To add classes to class libraries programmatically

  • Use the ADD CLASS command.

For example, the following line of code adds the class MyClass to MyClassLibrary:

ADD CLASS MyClass TO MyClassLibrary2

For more information, see ADD CLASS Command.

See Also

Tasks

How to: Add Properties to Classes
How to: Add Methods to Classes

Other Resources

Managing Classes and Class Libraries