I have a form with three main components:
Everything starts out looking great. But the FlowPanel that is aligned to the bottom is also set to AutoSize. It contains a panel that can collapse itself. The internal panel contains summary information that the user can decide to hide. This drops the size of the FlowPanel to a very small size but not completely gone. There is still a button where the user can re-expand the summary panel.
The problem comes when the panel is re-expanded causing the FlowPanel to grow. At that time the order of the Status Bar and the FlowPanel is reversed. They are both still set to align bottom but now the status bar is above my FlowPanel.
I can duplicate this in a test app without the Collapsing panel just by putting button on the form to see the bottom flow panel's height. If the height is increased the order changes. If it is decreased then everything stays in the same order. The only code in my test form is:
FlowPanel2.Height := FlowPanel2.Height * 2;
I also tested this with the bottom panel being a regular TPanel instead of a FlowPanel with the same results.
Any ideas on why this is happening and how to prevent it?
My Solution:
Now you should have no problems with that anymore
I sometimes have this too. My solution is to set Top of the control that shall be at the bottom to a "big enough" value - something like OtherControl.Top + OtherControl.Height + 1
should work or even MaxInt
IIRC.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With