You can use
TextRenderer
http://msdn.microsoft.com/en-us/library/system.windows.forms.textrenderer.aspx[
^] to determine what size the text box needs to be in the
TextChanged
event of the textbox - or better yet do as OriginalGriff suggests and make your own re-sizing custom control inheriting from
System.Windows.Forms.TextBox
Example
private void textBox1_TextChanged(object sender, EventArgs e)
{
TextBox t = (TextBox)sender;
Size s = TextRenderer.MeasureText(t.Text, t.Font);
t.Width = s.Width;
}