Using inheritance to build user objects

When you build a user object that inherits its definition (properties, events, functions, structures, variables, controls, and scripts) from an existing user object, you save coding time. All you have to do is modify the inherited definition to meet the requirements of the current application.

For example, suppose your application has a user object u_file_view that has three CommandButtons:

If you want to build another user object that is exactly like the existing u_file_view except that it has a fourth CommandButton, you can use inheritance to build the new user object, and then all you have to do is add the fourth CommandButton.

StepsTo use inheritance to build a descendent user object:

  1. Click the Inherit button in the PowerBar, or select File>Inherit from the menu bar.

  2. In the Inherit From Object dialog box, select User Objects from the Objects of Type drop-down list.

  3. Select the target as well as the library or libraries you want to look in.

    NoteDisplaying user objects from many libraries To find a user object more easily, you can select more than one library in the Libraries list. Use Ctrl+Click to toggle selected libraries and Shift+Click to select a range.

  4. Select the user object you want to use to create the descendant, and click OK.

    The selected object displays in the User Object painter and the title bar indicates that the object is a descendant.

  5. Make any changes you want to the user object.

  6. Save the user object with a new name.