How to resize panels inside a form accordingly?
My form has 3 panels
If I set panel2.visible to false, panel3 occupies the space.
If I set panel1.visible to false, panel3 also occupies the rest.
Going back to original form - all 3 panels are present.
If I set panel1.visible to false, panel2 and 3 occupies the space of panel1
Once panels 1 or 2 are visible again, panel 3 will go back the way it was.
It seems that as per your cases in question. Panel1 will be always on top even when panel 2 and 3 are hidden. In same way panel 2 will be always left aligned. Panel 3 will be always occupy available space .
Please set dock properties on panel control.
Panel1.Dock = top
Panel2.Dock = left
Panel3.Dock = fill
One more thing when controls are hidden make their sizes as 0. And When visible set sizes to default.
I hope this helps.