Flowlayout panel and autosizing child controls doesn't work
Posted
by Pete
on Stack Overflow
See other posts from Stack Overflow
or by Pete
Published on 2010-05-07T12:55:30Z
Indexed on
2010/05/07
12:58 UTC
Read the original article
Hit count: 322
I am trying to get a very simple autosizing layout on a winform (C# .NET). I've tried TableLayoutPanels and FlowLayoutPanels but nothing works.
I have a usercontrol which is a container for other usercontrols which are created at runtime - I've called it StackPanel as I want it to list the child controls vertically. I've tried this using a FlowLayoutPanel, TableLayoutPanel and a Panel (with each control docked to the top).
The child usercontrol consists of a label and then any number of radiobuttons (or any other standard control - it doesn't matter).
When the child controls are created, the label text is set (if this is long it needs to wrap to a new line) and the radio buttons are added.
There seems to be no combination of docking/autosizing or manual size setting using the Resize events that can get everything to show without clipping and still resize with the form.
Thanks!
© Stack Overflow or respective owner