private void btAdicionar_Click(object sender, EventArgs e) { CadastroAdotante tela = new CadastroAdotante(); tela.FormClosed += Tela_FormClosed; tela.MdiParent = this.MdiParent; tela.Show(); }
private void btAlterar_Click(object sender, EventArgs e) { if (dgAdotantes.SelectedRows.Count == 0) { MessageBox.Show("Selecione um adotante"); return; } int adotanteId = (int)dgAdotantes.SelectedRows[0].Cells[0].Value; CadastroAdotante tela = new CadastroAdotante(); tela.FormClosed += Tela_FormClosed; tela.AdotanteId = adotanteId; tela.MdiParent = this.MdiParent; tela.Show(); }