Hi,
while working on a project involving Popup forms I noticed that while creating the forms using the same method shown in the MultiForm demos, the ChildOrder property doesn't seem to be working.
The documentation says that in order to make the ChildOrder property work correctly, the parent of the elements has to be set to position relative but that still doesn't solve the issue.
In particular:
- TAwait.ExecP(frm.Load()); // ChildOrder DON'T Works.
- frm := TForm1.CreateNew(@AfterCreate); // ChilDOrder Works.
I created this example so you can see the problem with various form creation methods.
Test child order.zip (1.7 MB)
Ps.:
There is also another issue that was already partially discussed by user Zohair Hussain in 2021 ( Childorder not working as expected - #4 by Zohair_Hussain ). In a form with various TWebHTMLDiv containing other elements, the elements inside one of the DIVs weren't responding correctly to the ChildOrder. I struggled for a while to make it work but ultimately solved the issue by cutting and pasting the element back in the form. While the solution seems simple in this situation, with bigger forms with a lot more elements it would be pretty complicated to find the right element to cut and paste. All the elements were Block elements, created at design-time, ChildOrder starting from 0 for the first element inside the parent and in position relative.