I have a custom Windows Forms (a class which extends System.Windows.Forms). Its layout is as follows:

- FLP: Flow Layout Panel. Flow directions is specified in the name.
- PB: Picture Box
- RTB: RichTextBox
-
b: Button
Onto the problem: it is possible for the FLP at the bottom to be empty (no buttons). When that happens, I’d like it to shrink to zero height, and let the FLP above, and the RTB, grow and fill that space. This is because all that empty space looks ugly when there are no buttons.
I configured the lower flp withAutoSize = TrueandAutoSize = GrowAndShrink. Then, for the upper flp, I setAutoSize = True,AutoSizeMode = GrowOnlyandDock = Fill. But when I create a form with no buttons, the space is still there. If I draw the control borders, where the lower flp should be, I see a little square dot.
Where am I going wrong?
UPDATE: I’m willing to redo the layout in a more convenient way, or even redo the whole form using WPF.
I doesn’t look like you need the Top-Down FlowLayoutPanel.
Try taking your Right-Left FlowLayoutPanel and Dock it to the bottom. Then take your Left-Right FlowLayoutPanel and Dock Fill it in the remaining area.
Where your button panel has no visible buttons, then you can just hide the panel and the Filled panel will take up that remaining space.