/* Aba instituição */ private void btnPesquisarInstituicao_Click(object sender, EventArgs e) { var cnpj = txtPesquisaInstituicao.Text.Replace(" ", ""); if (cnpj.Length < 18) { MessageBox.Show( @"É necessário o preenchimento do campo.", @"Preenchimento obrigatório", MessageBoxButtons.OK, MessageBoxIcon.Warning ); } else { dataGridInstituicao.DataSource = Instituicao.BuscaUnica(txtPesquisaInstituicao.Text); } }