Timing of property initialization

@JuliaTruchsess
The sequence Tim laid out is incorrect
Its more like

Instantiate the Window
Call the Window Constructor

Window Constructor:
Instantiate each Control
Call Constructor on the Control
Set all properties

Call Window.Open, which
   – calls open on every control

IF you want a specific value for a property to be set, by default, make sure you set that value in the Inspector Behaviour
You can tell WHEN you are being called by examining a stack you grab by raising an exception you catch

These might be of use
https://www.great-white-software.com/blog/2020/01/21/creating-custom-controls/
https://www.great-white-software.com/blog/2019/09/01/good-habits-when-creating-custom-controls/
https://www.great-white-software.com/blog/2019/05/28/why-shadowing-should-be-avoided/
https://www.great-white-software.com/blog/2019/06/17/follow-up-on-why-shadowing-should-be-avoided/

fwiw this can be discerned by

  1. new desktop project
  2. new subclass of a control ( I used a pushbutton)
  3. to the subclass add a no parameter constructor with this code super.constructor
    put a break statement on the call to super.constructor
  4. to the subclass implement the open event with just a break statement
  5. to the subclass add a computed property for width
    in get put Return PushButton(Self).Width
    in set put PushButton(Self).Width = value
  6. add an instance of this to the default window for the project
  7. add a no param constructor to this default window with this code Super.Constructor
    put a break statement on the call to super.constructor
  8. implement the open event with just a break statement

run

alternatively put a system.debuglog currentmethodname in each then review the log

Thanks, Norman, very helpful as always :slight_smile:

Best,
Julia