dotnetmonitor.com

 
Index
Previous
Next

 

Here is the scenario:

 

Simply setting Button.AutoSize=true on each button will break your alignment, since the localized strings are likely to be different lengths - so you'd get this:

 

The solution is to place the three (or however many) buttons (or whatever controls) in a vanilla, non-flow or table Panel* like this:

and anchor the buttons Left and Right. Then set the Panel to AutoSize, and when the text is changed, causing the buttons to adopt different lengths, the largest button "pushes" the Panel to the size it needs, and the anchors on the other (smaller) buttons "pulls" the smaller buttons to the same size, ala:

Terms
Docking Anchor Layout
What happens when I have Dock and Anchors that conflict?
Dock Scenarios
Padding Margin
You have a perf problem with Layout - how to diagnose?