What I want to do is that when I reach the limit of 10 characters that the user wrote on my little system I made an error and I did not write anymore, but what happens is that it only marks the error but every time I enter a new one number receives it and puts it in the textbox
This is the restriction code and it is in the textbox.
private void clave_TextChanged(object sender, EventArgs e)
{
if (clave.Text.Length>10) {
MessageBox.Show("Error");
}
}