Tag Archives: resize TextBox

Resize a TextBox to fit its text in C#

This example shows how you can resize a TextBox to fit its contents as the user types. The key is the following AutoSizeTextBox method. // Make the TextBox fit its contents. private void AutoSizeTextBox(TextBox txt) { const int x_margin = … Continue reading

Posted in controls, user interface | Tagged , , , , , , , , , , , | 1 Comment