Nested flowlayout panel not wrapping
- by SnOrfus
I've got a FlowLayoutPanel with properties:
Dock = Fill (in a usercontrol)
FlowDirection = TopDown
WrapContents = false
I do it this way so that each item added to the panel gets added to the bottom.
The items that I add to this panel are usercontrols which themselves have FlowLayoutPanels on them, however they have the standard behaviour (LeftToRight, WrapContents = true). The problem that I'm having is that the interior usercontrol's FlowLayoutPanel isn't resizing to fill the outer control, but when I set autosizing to true on these controls, then the panel won't wrap its contents - which is a known problem apparently.
If it helps visualize what I'm trying to do, it looks like this:
______________________________
| __________________________ | Outer box = exterior flowlayout
| |Text____________________| | (TopDown, NoWrap)
| | # # # # # # # # # # # #| |
| | # # # # | | Interior boxes = usercontrols with text and a
| |________________________| | flowlayoutpanel on them
| __________________________ | (LeftToRight, Wrap)
| |Text____________________| |
| | # # # # # # # # # # # #| | # = pictures
| | # # | |
| |________________________| |
|____________________________|