I need to arrange a number of elements (in this example: labels) and add and remove them during runtime. The big issue I have is that these elements need to have a "fixed" position, e.g. lblA needs to be always at 0, 0. Maybe this illustration is more helpful:
BUT, and that's really bothering me, the tableLayoutPanel should autosize and not be wider than needed, so if only A, C and F are displayed it should look like this:
Now if I add X, it should look like
BUT, if I remove A and add Y, it should look like:
Get the point? I could use either use a flowLayoutPanel but would not have any control of where the labels will be placed (only flowDirection) or use a tableLayoutPanel and will have a problem when for example A, C and Z are displayed:
(__ is an empty cell)
Z should be displayed always last but still not in a second row. I tried TableLayoutPanelGrowStyle.AddColumns but still, this is not what I'm looking for.
Is there any built-in feature of either the flowLayout- or tableLayoutPanel that I've overseen?