Event Handlers

Event handlers are a specialized methods. Each class in the DataFlex class library will raise certain events during important operations. For example, the TreeView class supports many Event events such as:

These events are the points at which you can design specialized behavior for the class during important operations. You design the specialized behavior by writing the appropriate event handler in your class declaration. You need to study the documentation for each class to determine which event methods are available for augmentation.

An example of augmenting Event methods follows:

Class  cMyButton  is a Button

    Procedure OnClick

        Send Info_Box "I have been clicked"



In this example we have designed a new button class called cMyButton. The OnClick event has been augmented so that each time the button is clicked a message will be displayed.