Constructor overridden by public properties...

I’m trying to set a constructor method on my subclass PushButton and it got overridden by Public properties…
I can’t use Open event, i use it all around the app.

The strange thing is :

if i do windowXYZ.show
the subclassPushbutton’s constructor works fine
but if i do
w as a new windowXYZ(someparam)
the subclasspushbutton’s constructor got overriden by the public properties…

how can i work around that ?

PS : no open event ! it’s already in use in sooooo many button

When you place an instance of a control on a layout (a window) it gets a set of values (not so much properties as those are defined by the super)
This way each instance can have its own values for the different properties - controls would be kind of useless if you could not have buttons with different captions etc

Then, at runtime, when you show the layout (or construct one) the framework constructs the layout and then basically for each control executes code that is analogous to

          thisNewControl = new <Control of whatever type>
          thisControl.setallyourproperties

so anything in the constructor that sets a property may just get overwritten when the controls properties are set to the values from the layout

This has been true forever (literally) - and isn’t considered a bug FWIW

The “workaround” is to use the open event

but why “mywindow.show” vs “new mywindow” doesn’t do the same order with the constructor ?

New Mywindow must have implictinstance off in the ide. Not sure what your setup is though

I’d have to see a sample that shows this
There’s no reason they should be any different