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 with
AutoSize = True
andAutoSize = GrowAndShrink
. Then, for the upper flp, I setAutoSize = True
,AutoSizeMode = GrowOnly
andDock = 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.