How to: Support Localization on Windows Forms Using AutoSize and the TableLayoutPanel Control
One of the difficulties you may encounter when you localize your application is changes to your layout introduced by text strings of varying lengths. The AutoSize property and the TableLayoutPanel control can be helpful in creating layouts that can adapt to different text string lengths that you cannot anticipate at design time.
The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Working with Settings.
Enabling a Layout that Adapts to Varying String Sizes
The AutoSize property causes a control to size itself to its content. The TableLayoutPanel control provides a proportional resizing capability that enables controls to retain the same relative size when they are resized to fit their contents.
To enable automatic sizing for localization
Open the Columns and Row Styles dialog box. For more information, see How to: Edit Columns and Rows in a TableLayoutPanel Control. Select Column1 and change the value of its SizeType property to AutoSize. Click the OK button to accept your changes.
Set the value of the Button control's Text property to a long string, for example "This is a long string to demonstrate a localizable form." The Button control and the TableLayoutPanel cell are resized to fit the new string length.
Move the TableLayoutPanel control so it is flush with the lower-right corner of the form.
Set the value of the form's AutoSize property to true.
Change the value of the Button control's Text property to a long string, for example "This is a long string to demonstrate a localizable form." If the string is long enough, it causes the TableLayoutPanel control and the form to increase in size.