Feedback
RaiseEvent in control event handler targets source control and can recurse until stack overflow
- Status
- Fixed
- Fixed in
- v26.5.5
- Source discussion
- https://forum.objo.dev/d/59-event-handler-and-event-definition-with-same-name-error-1
- Last updated
- 2026-05-21
Public summary
RaiseEvent inside a Studio-generated control event handler can raise the control's event instead of the containing object's event.
Reproduction:
- Add an
Opening()event to aButtonon a window - Create an event definition in this button called
Opening - Add
RaiseEvent Openingto theOpeningevent of theButton - Run the program
Expected:
RaiseEvent Opening should raise Window1.Opening.
Actual:
It raises Button1.Opening again, recursively invokes Button1_Opening, and eventually fails with:
Runtime error: Stack overflow (too many nested calls).
App exited with code 1.