Coding event methods

Demos

Defining Event Subscriptions and Event Handlers (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.

As described in Creating event subscriptions, the quickest way to define an event method is to subscribe to the event by double-clicking in the Design Canvas or the Events tab. When you do this, you are taken to the automatically generated event-handling method in the ABL code, which is similar to the following:

METHOD PRIVATE VOID ultraButton1_Click ( sender AS System.Object, e AS System.EventArgs ):

END METHOD.

Add the appropriate event-handling code inside the method definition block.

The double-click technique minimizes typing and mistakes, but you can also use the Properties view to associate any method with an event. On the Events tab, click in the value cell to the right of the event name. The down-arrow button that appears lets you select from a drop-down list of all methods defined in the source code whose signature matches that of the selected event. Alternatively, you can type a method name in the cell.
Note: If you wish, you can disable the automatic generation of event code at the Visual Designer Preferences page. Select Window > Preferences > Progress OpenEdge > Visual Designer and uncheck the Generate event handler on double-click option.

You can change the name of the event handler method by editing the value on the Events tab. The change is reflected in the source code.