اين هم همون كد برای TextBox
if (e.KeyValue != 46 && e.KeyValue != 8)
if (textBox1.Text.Length % 11 == 0 && textBox1.Text.Length != 0)
{
textBox1.Text += "\r\n";
textBox1.Select(textBox1.Text.Length, 0);
}
فقط اين الگوريتم مشكلی كه داره اينه كه كاراكتر های enter رو هم حساب می كنه كه نبايد حساب كنه. می تونی از كد زير استفاده كنی.
if (e.KeyValue != 46 && e.KeyValue != 8)
{
if (textBox1.Text.Replace("\r\n", null).Length % 11 == 0 && textBox1.Text.Replace("\r\n", null).Length != 0)
{
textBox1.Text += "\r\n";
textBox1.Select(textBox1.Text.Length, 0);
}
}