Graphics txtGraphics = this.textBox1.CreateGraphics();
float width = txtGraphics.MeasureString(textBox1.Text, textBox1.Font).Width;
this.Text = width.ToString();
txtGraphics.Dispose();
پروژه مثال ضمیمه شده است.
 
			
			 
			
			
			
			 
			
				 بدست آوردن میزان عددی طول رشته ی درون یک TextBox
 بدست آوردن میزان عددی طول رشته ی درون یک TextBox
				Graphics txtGraphics = this.textBox1.CreateGraphics();
float width = txtGraphics.MeasureString(textBox1.Text, textBox1.Font).Width;
this.Text = width.ToString();
txtGraphics.Dispose();
پروژه مثال ضمیمه شده است.