Resizing event for TextField?

I have a custom class of type TextField, let’s call it cTF.

When I lock a cTF to the sides of a window and then resize the window, the cTF resizes as well.

When that happens I need to run some code in the cTF.

But there is no resizing / resized event for TextFields.

Is there a way to do this WITHOUT putting code in the window or putting the cTF on a ContainerControl? Basically I want all the code inside the cTF.

create a method in your custom class… and have the Window Resize Event call that class

Function WINDOW.RESIZE
    myTextfield.callSomeFunction
End function

this way the custom object controls HOW things are done, when the Window decides WHEN it will be done

Thanks, but I am trying to do it

you can’t

Use a 500 ms multiple timer to monitor your control’s dimensions.

The solution should have been to shadow the Width & Height properties but that doesn’t work when constraints are used.
<https://xojo.com/issue/50397>