Skip to content

ControlValue - cComActiveXControl

Used as a hook to link a property in the ActiveX control with the Value Property

Type: Property
Access: Read/Write
Data Type: String
Parameters: None

Syntax

Property String ControlValue
Access Type Syntax
Read Access: Get ControlValue to StringVariable
Write Access: Set ControlValue to StringVariable/Value

Description

The ControlValue property is used as a hook to link a property in the ActiveX control with the Value property. To do this, you'll need to find the messages in the control that Get and Set its data value and create Get ControlValue and Set ControlValue methods. These methods should be written to Get and Set the ActiveX control's 'real value' property.

The name of this 'real value' property is defined by the ActiveX control and could be any name. For example, the Calendar control's real value property happens to be called ComValue, so the code that must be created is:

Function ControlValue Returns String
    Function_Return (ComValue(Self))
End_Function 

Procedure Set ControlValue String sVal
    Set ComValue to sVal
End_Procedure

This binding is normally done automatically by the COM wrapper class generator when you import an ActiveX control. You would only want to change this if you want to bind to a different ActiveX property, or if the ActiveX control did not publish a bindable property.

Once an ActiveX control's bindable property is bound to the Value property in this way, you can Get and Set the Value property at any time during the life span of the wrapper Object regardless of whether it is connected to its ActiveX control. Whenever the ActiveX control is connected to the wrapper, its bindable property will be initialized to the current Value property.

You may also need to identify the 'change event' and make it send OnControlValueChanged. See OnControlValueChanged for more information on doing so.

See Also

Value | pbBindValue