private void TxtNumeroDocumento_Leave(object sender, EventArgs e) { if (string.IsNullOrEmpty(TxtNumeroDocumento.Text)) { BtnGuardar.Enabled = false; TxtNumeroDocumento.Focus(); } else { DEmpleado bo = new DEmpleado(); if (bo.VerificarNumeroDocumento(TxtNumeroDocumento.Text)) { BtnGuardar.Enabled = true; TxtNumeroDocumento.BackColor = Color.FromArgb(126, 225, 154); } else { BtnGuardar.Enabled = false; TxtNumeroDocumento.BackColor = Color.FromArgb(241, 115, 117); TxtNumeroDocumento.Focus(); } } }