Graphics txtGraphics = this.textBox1.CreateGraphics();

float width = txtGraphics.MeasureString(textBox1.Text, textBox1.Font).Width;

this.Text = width.ToString();

txtGraphics.Dispose();