Control Properties

In addition to properties defined and implemented by the control itself, ActiveX controls technology also involves:

Ambient properties

These are exposed by the container through a control client site to provide environmental values that apply to all controls embedded in the container. For example, a container can provide a default background color or a default font that the control can use. Ambient properties are exposed through IDispatch implemented on a container's site object. The container calls the control's IOleControl::OnAmbientPropertyChange method when any of its ambient properties change value. In response, a control may need to update its own internal or visual state in response. The container indicates which ambient property changed with the DISPID parameter or may pass DISPID_UNKNOWN to indicate that multiple ambient properties changed.

Extended properties

These are actually implemented by a container to wrap the controls it contains to provide container-managed properties that appear as if they were native control properties. The container can aggregate the control, adding the extended properties to supplement or override the control's properties. The aggregated object is called an extended control. To the container, the extended control appears as the control itself and extended properties appear to be exposed by the control. The container supports an extended control through its client site method IOleControlSite::GetExtendedControl. The GetExtendedControl method allows controls to navigate through the site to the extended control object provided for them by the container, if the container supports this feature. A container can also choose to show property pages for its extended controls in addition to those pages that a control would normally specify through ISpecifyPropertyPages. Because of this, a control has to ask a container to show a property frame before the control attempts to do so itself. The control calls IOleControlSite::ShowPropertyFrame to do this. If the container implements this function then it shows the property frame itself; if the method returns an error then the control can show the property frame.

For more information, see the following topics:

Control Methods