Advanced PowerBuilder

HomePrevious Lesson: OLE Control Attributes
Next Lesson: Display Type

Contents

This attribute defines the content of the OLE control. This attribute only applies to circumstances where the content is dynamically allocated at run-time using the InsertObject() function. There are three possibilities:

Option

Description

Any:

Allows linked or embedded objects to be inserted

Embedded:

Allows only embedded objects to be inserted

Linked:

Allows only linked objects to be inserted

This allows you to assign an OLE object to the OLE control by clicking on the Add OLE Object button. Doing this brings up the standard Insert Object dialog box, allowing you to select the type of object you want to add.

If you select the Create from File option, you'll get the usual screen except that the link option isn't available.

This is because we've specified that the contents should be embedded. If you close the window, change the Contents attribute of the OLE control to linked and run the window again, clicking on the Add OLE Object button will then launch the select file dialog with the Link option already selected:

The Contents attribute is generally used to specify a default behavior as it can still be overwritten at run-time.
HomePrevious Lesson: OLE Control Attributes
Next Lesson: Display Type