Hello all,
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:
A D
B E
C F
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:
A
C
F
Now if I add X, it should look like
A X
C
F
BUT, if I remove A and add Y, it should look like:
C Y
F
X
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:
A
C
____Z
(__ 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?
Best Regards
Dennis