Event handler example
- Last Updated: January 17, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Event handler example
The following example shows an OCX event trigger for
the NewItem event of the CSComboBox control MyCombo in
control-frame CtrlFrame-2:
|
This event occurs when a user enters an item in the text box that is not in the combo box list.
The programmer uses the COM-SELF handle to add the
new text item to the list with the AddItem() method. Setting i-KeepFocus to
-1 ensures that the control maintains input focus after the item
is added to the list.
If this event procedure is in the AppBuilder-generated application
file, the programmer might otherwise choose to call the AddItem() method
indirectly using the component handles provided by the AppBuilder
(chCtrlFrame-2) and the control-frame COM object
(MyCombo property):
|