how to apply check on character length in c# code example Example: count text length c# int X = textBox1.Text.Length;