これじゃだめですか? private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { if (textBox1.Text.Length >= 10) { textBox1.Text = ""; } } あと、BSキーなどで文字が減るなど特殊な場合を 考慮すればいいと思います。
管理者用
- Child Tree -