I got a ScrollBox, and creating few GroupBoxes inside dynamically with alTop property. When I create them first time after application run, the first created is top most. And that's fine. But when I free them all and create again in same order, top most is the last one. And every time when doing that again, it will be last one until application restart. Only after restart, it creates it in right order... Why is that? Any idea on how to fix that?
When you create controls dynamically using the Align
property, you need to take care over their positioning. Assuming you use alTop
, follow this strategy:
Top
to 0. Top
to be the bottom of the first control. Top
is to be set to the bottom of the previous control. This question appears to be related: How to dynamically create controls aligned to the top but after other aligned controls?