create a rollout and place 2 panels with Align=alTop into it (panel1 lies now on the top of the panel2). if you start this application, collapse this rollout and expand it again, the panels are switched, the panel1 lies now below the panel2.

Additional Information

bug in the (relatively new) method CheckVisibility. The alignment must be disabled during the visibility setting task. 4 added lines are commented.