Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
txtchildという名前のテキストボックスがあります。2 桁の数字だけでいいのです。ユーザーが 2 桁以上の no を入力すると、エラー メッセージが表示されます。
助けてください
private void txtchild_KeyPress(object sender, KeyPressEventArgs e) { if(txtchild.Text.lenght>2) { e.Handled = true; } else { MessageBox.Show("Value must be Two digit"); } }