From RAD Studio API Documentation
Jump to: navigation, search



TOleContainer = class(TCustomControl, IUnknown, IOleClientSite,
IOleInPlaceSite, IAdviseSink, IOleDocumentSite, IOleUIObjInfo)


class PASCALIMPLEMENTATION TOleContainer : public Vcl::Controls::TCustomControl


Type Visibility Source Unit Parent
class public
Vcl.OleCtnrs Vcl.OleCtnrs


TOleContainer embeds or links OLE objects.

Use TOleContainer to handle many of the complexities of OLE 2.0. TOleContainer lets the user choose an OLE object to insert by simply calling the InsertObjectDialog method. TOleContainer can create either an embedded OLE object or a linked OLE object.

TOleContainer automatically handles menu merging -- the process of combining the container form's menu with that of an in-place activated OLE object's server application. The menu items' GroupIndex property settings control how menus are merged. Those main menu items with GroupIndex values of 0, 2, and 4 remain; TOleContainer merges the server application's menus and replaces the main menu items with GroupIndex values of 1, 3, and 5 (if they exist).

OLE objects that are activated in-place add their server's toolbars directly into the container application's window. Normally, any panels used for toolbars are replaced by the OLE object's server's toolbars. Prevent this by setting a panel's Locked property to true.

When using TOleContainer in an SDI application (the main form's FormStyle property is fsNormal rather than fsMDIForm), place the TOleContainer component inside a panel whose Align property is set to alClient. TOleContainer replaces an SDI form's toolbars as described above, and using a panel automatically adjusts the amount of space available to the OLE container.

See Also