# Events implemented in parent class not available in inheriting class (Xojo)

**URL:** <https://ifnotnil.com/t/events-implemented-in-parent-class-not-available-in-inheriting-class-xojo/3089>\
**Category:** General Programming\
**Created:** [16 February 2023 20:39 UTC](https://ifnotnil.com/t/events-implemented-in-parent-class-not-available-in-inheriting-class-xojo/3089 "2023-02-16T20:39:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgrommes](https://ifnotnil.com/user_avatar/ifnotnil.com/bgrommes/32/2651_2.png) [@bgrommes](https://ifnotnil.com/u/bgrommes)\
**Post date:** [16 February 2023 20:39 UTC](https://ifnotnil.com/t/events-implemented-in-parent-class-not-available-in-inheriting-class-xojo/3089/1 "2023-02-16T20:39:58Z")

</div>

OK I must be missing something here. I have a control subclassed from DesktopComboBox that implements Opening() and FocustLost(). It is called DesktopComboBoxAutoComplete.

A control of type DesktopComboBoxAutoComplete does not allow me to implement Opening() or FocustLost() in the IDE. So if I want to augment that behavior (call Super.Opening() at some point in the control’s Opening event) there’s no way to do it. It’s like those methods are sealed once implemented.

Is this “by design” or something? Any workaround?

Or must I make a subclass DesktopComboBoxAutoComplete with the required changes before dropping it on the designer?

---

<div class="post-metadata">

**Author:** ![bkeeney](https://ifnotnil.com/user_avatar/ifnotnil.com/bkeeney/32/225_2.png) [@bkeeney](https://ifnotnil.com/u/bkeeney)\
**Post date:** [16 February 2023 20:59 UTC](https://ifnotnil.com/t/events-implemented-in-parent-class-not-available-in-inheriting-class-xojo/3089/2 "2023-02-16T20:59:26Z")

</div>

You have to create new Opening and FocusLost events to mirror the ones you’ve already used. So in the Opening event of DesktopComboBox you’ll raise the Opening event you’ve created. I forget the mechanism but you can right click on the Opening event and there’s a menu option to define a new event using the selected one.

Sorry, haven’t touched Xojo in a few months so the exact commands get a little fuzzy.

---

<div class="post-metadata">

**Author:** ![Alberto](https://ifnotnil.com/letter_avatar_proxy/v4/letter/a/ea5d25/32.png) [@Alberto](https://ifnotnil.com/u/Alberto)\
**Post date:** [16 February 2023 21:04 UTC](https://ifnotnil.com/t/events-implemented-in-parent-class-not-available-in-inheriting-class-xojo/3089/3 "2023-02-16T21:04:20Z")

</div>

Create Event Definition from Event:  
 ![image](https://ifnotnil.com/uploads/default/original/2X/1/1b28703605b50c8cf59b178fcd0540eaae8fa21b.png)

---

<div class="post-metadata">

**Author:** ![bgrommes](https://ifnotnil.com/user_avatar/ifnotnil.com/bgrommes/32/2651_2.png) [@bgrommes](https://ifnotnil.com/u/bgrommes)\
**Post date:** [16 February 2023 22:07 UTC](https://ifnotnil.com/t/events-implemented-in-parent-class-not-available-in-inheriting-class-xojo/3089/4 "2023-02-16T22:07:58Z")

</div>

Thanks, Alberto … So now I would have an Event Definition Opening() as well as an Event Handler Opening() … which I could then raise from the child class, if I’m following that correctly.

---

<div class="post-metadata">

**Author:** ![npalardy](https://ifnotnil.com/user_avatar/ifnotnil.com/npalardy/32/10_2.png) [@npalardy](https://ifnotnil.com/u/npalardy)\
**Post date:** [16 February 2023 22:09 UTC](https://ifnotnil.com/t/events-implemented-in-parent-class-not-available-in-inheriting-class-xojo/3089/5 "2023-02-16T22:09:07Z")

</div>

Yes - once a control implements the event in order you have to add an event definition and reraise the event to make it so other instances can implement the event
