Window Resizing event

When subclassing, every now and then I run into a situation where I would like to use an event from some other control.

Today I ran into this example.

I Subclassed a canvas that goes to work when the window is being resized. (It repositions itself based on other control positions.)

The Window.Resizing event fires when all controls have drawn and that’s perfect but this means that I need to call my Subclass.Update method from the Windows.Resizing event.

I’m looking for a way to handle it in the subclass itself and not let the window fire the update method.

In the Paint event, I tried checking if the Window.Height or Window.Width has changed. If so, I call the Update method. But this is triggered in the middle of redrawing the controls and not at the same moment as the Window.Resizing event.
The same goes when using a timer or CallLater.

So the Window.Resizing event fires at the perfect moment but I’m trying to let the Subclass figure it out instead of triggering it from Windows.Resizing.
Is there an ‘addHandler’ -way that my SubClass can use to somehow tap into another controls event? So in this case, the Window.Resizing event?

I’m curious why you would want to if it’s already perfect?

I always try to do better than perfect. :slight_smile:
But well, it’s a subclass. I just want to be able to throw many on there and be done with it. Since I’m figuring out new things every day, I just wonder if something like that is possible and never knew about it.

You cannot addhandler if the handler has already been implemented in the iDE.

Use a timer in the subclass to monitor the window size.