Flowlayout panel and automatic child control do not work

I am trying to get a very simple autosave layout on winform (C # .NET). I tried TableLayoutPanels and FlowLayoutPanels, but nothing works.

I have a usercontrol that is a container for other user controls created at runtime. I called it StackPanel as I want it to display child controls vertically. I tried this with FlowLayoutPanel, TableLayoutPanel and panel (each control is attached to the top).

Children's user control consists of a tag, and then any number of radio objects (or any other standard control - it does not matter).

When child controls are created, the label text is set (if it is long, it must be wrapped in a new line) and the switches will be added.

It seems that there is no combination of docking / auto-separation settings or manual size using Resize events that can display anything without cropping and resizing using the form.

Thank!

+3
source share
1 answer

I had a similar experience with both panels.

FlowLayoutPanel:

Basically, you should leave the child widgets snapped to the top left. Do not fasten them. Also do not snap them to the right. Automatic label calibration will only work in this configuration.

FlowLayoutPanel .

+2

Source: https://habr.com/ru/post/1744505/


All Articles