Try OpenEdge Now
skip to main content
ABL Reference
Handle Attributes and Methods Reference : Control-Name property
 

Control-Name property

(Windows only; Graphical interfaces only)
The component handle to an ActiveX control that has the specified design-time name (Control-Name) and that is loaded into the control-frame.
Data type: COM-HANDLE
Access: Read-only
Applies to: CONTROL-FRAME widget, COM object
Another way of getting a component handle to an ActiveX control is to access it through the control collection. For more information, see the Controls property entry.
References to COM object properties and methods extend the syntax used for referencing widget attributes and methods. For more information, see Accessing COM object properties and methods.
To return the component handle of the ActiveX control, you provide the design-time name as a property of the control-frame COM object. In the following example, Spin is the name of an ActiveX control and is also used as a property to return the handle to that control:
DEFINE VARIABLE hSpin            AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE hControlFrameCOM AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE hControlFrame    AS HANDLE     NO-UNDO.

/* Instantiate the control-frame with hControlFrame and load the Spin control
   into it*/
hControlFrameCOM = hControlFrame:COM-HANDLE.
hSpin            = hControlFrameCOM:Spin.
This is the simplest technique to access an ActiveX control that is loaded in a control frame.