private void TxtCfop_Validated(object sender, EventArgs e) { if (TxtCfop.Text != "") { Verificar ExisteCFOP = new Verificar(); ExisteCFOP.Controle = Controle; if (!ExisteCFOP.VerificarCadCFOP(int.Parse(TxtCodigo.Text), TxtCfop.Text)) { MessageBox.Show("CFOP já cadastrado", "Alerta", MessageBoxButtons.OK, MessageBoxIcon.Error); TxtCfop.Focus(); } } }