Try OpenEdge Now
skip to main content
Programming Interfaces
External Program Interfaces : ActiveX Control Support : Programming ActiveX controls in the AppBuilder : Initializing the control
 
Initializing the control
The programmer creates the initialize-controls procedure if they want to modify control properties before the control becomes visible. In addition to initializing the component handle to the CSSpin control, the example procedure gets the initial setting of the CSSpin Value property. This allows the correct value to display when enable_UI visualizes the Customer Information dialog box for the first time. For example:
/* ********************** Internal Procedures *********************** */
. . .

PROCEDURE initialize-controls :
/*------------------------------------------------------------------------
Purpose:
Parameters: <none>
Notes:
------------------------------------------------------------------------*/
  chCSSpin = chcustSpin:CSSpin.

  /* Initialize iRecordCount from the initial spin control value after
     control is loaded. */
  iRecordCount = chCSSpin:Value.
END PROCEDURE.
Note: The initialize-controls procedure is the earliest place provided by the AppBuilder Section Editor to dynamically modify properties for UI-enabled ActiveX controls.
After an ActiveX control instance is loaded, you can interact with it in several ways. You have just seen how you might retrieve a property value to display during user interface initialization. The most common interactions with an ActiveX control occur in the ABL event procedures that you write to handle OCX events.