Step 7: Use the visual extension in an application

PowerBuilder Native Interface

Step 7: Use the visual extension in an application

You do not need to declare an instance of a visual class or use the CREATE statement to create an instance. The PBVM creates an instance when the window or visual control in which the visual class resides is opened, as described in "Creating visual class instances". You can invoke the object's functions the same way that you invoke a nonvisual object's functions.

Steps To use a visual extension:

  1. Select File>Inherit from the PowerBuilder menu and select the PBD in the Libraries list in the Inherit from Object dialog box.

  2. Select the visual class and click OK.

  3. In the User Object painter, size the visual object and make any other changes you need.

  4. Save the object.

    You can now drag the new user object from the System Tree directly onto a window or onto another visual control, such as a tab control, and use it like any other visual user object.

Note Code samples

The code fragments in the rest of this section are based on complete sample applications that you can find on the PowerBuilder CodeXchange Web site .