Creating an inherited control

Demos

Creating a Data-bound Treeview as an Inherited Control (Part 1)

Creating a Data-bound Treeview as an Inherited Control (Part 2)

Note: The OpenEdge Release 10.2B demos have not been updated for OpenEdge Release 11.0. Since 10.2B, OpenEdge Architect has been renamed as Progress Developer Studio for OpenEdge. In addition, OpenEdge Release 11.0 includes some feature enhancements and other changes. Despite the differences between 10.2B and 11.0, the demos are still a useful introduction to Progress Developer Studio for OpenEdge.

An inherited control is an extension of an existing control class. For example, you might create a custom button with specific properties and behavior that you want to incorporate in multiple UI forms.

  1. Select File > New > ABL Inherited Control.
  2. Enter a value in the Control name field. The name must begin with a letter; spaces and most non-alphanumeric characters are not allowed.
  3. In the Inherits field, specify the control class on which the new inherited control is to be based. The best way to enter this value is to click Browse and select the parent class from the list that appears. Alternatively, you can enter the value by typing.
    Note: The class from which the new control inherits must be or must inherit from System.Windows.Forms.Control.
  4. The remaining fields are optional, with the exception of the Package root (required). Enter appropriate values as described in the New ABL Inherited Control wizard reference help.
  5. After entering the desired values, click OK. Progress Developer Studio for OpenEdge creates a new class file with the same name that you assigned to the control. A Visual Designer editing window opens.
    Note: Depending on the class from which your control inherits, it may not be possible to display a visualization of the design at this stage. In that case, the Design Canvas appears with a yellow background and a message supplied by the Microsoft .NET Framework. You can still add content to the Design Canvas and use the Properties and Events tabs to define the characteristics of the inherited control, but you do not see the GUI as it will actually appear. You can also view and edit the ABL source code (right-click in the Design Canvas and select View Source, or press F9).

    You might find it helpful to create a "scratch pad" form and place an instance of the parent control on it. You can use this test form to experiment with property settings and see the results. When the control appears the way you want it, you can duplicate the values in the Properties view for your actual inherited control.

  6. Add the desired controls to the container and define their properties, data bindings (as necessary), and event logic.
  7. Save the CLS file.

After defining the custom control, you must add it to the Toolbox to make it available for use in OpenEdge GUI for .NET forms.

Note: If you move the CLS file for an inherited control from its original disk location to a location that is not on the project PROPATH, you must add the new location to the PROPATH. Otherwise, the type is unavailable, and the Visual Designer cannot open the control or any form containing an instance of the control.