コード例 #1
0
        private void txtNombreCliente_KeyPress(object sender, KeyPressEventArgs e)
        {
            string nombreCli = txtNombreCliente.Text;

            if (!Rutinas.ValidaCaracteres(nombreCli + e.KeyChar.ToString()) && e.KeyChar != (char)Keys.Back)
            {
                errorP.SetError(txtNombreCliente, "El nombre del cliente solo acepta caracteres alfabeticos.");
                e.Handled = true;
            }
            else
            {
                errorP.SetError(txtNombreCliente, "");
            }
        }