private void btAddNovo_Click(object sender, EventArgs e) { formAdicionarAdmin addAdmin = new formAdicionarAdmin(this, dbContainer); addAdmin.FormClosing += new FormClosingEventHandler(formUserAdmin_FormClosing); // *1* addAdmin.ShowDialog(this); }
private void btEditar_Click(object sender, EventArgs e) { currentAdmin = adminList.ElementAt(lbAdmin.SelectedIndex); formAdicionarAdmin aditAdmin = new formAdicionarAdmin(this, dbContainer, currentAdmin);//editar a true muda o form de forma aditAdmin.FormClosing += new FormClosingEventHandler(formUserAdmin_FormClosing); aditAdmin.ShowDialog(this); }