private void btnAgregar_Click(object sender, EventArgs e) { EditaCarrera frm = new EditaCarrera(this); frm.Show(); this.Visible = false; verDatos(); }
private void btnEditar_Click(object sender, EventArgs e) { try { if (tblTabla.CurrentRow != null) { id = this.tblTabla.CurrentRow.Cells[0].Value.ToString(); EditaCarrera frm = new EditaCarrera(this, id); frm.Show(); this.Visible = false; verDatos(); } else { MessageBox.Show("Debe seleccionar una fila de la tabla", "Error de selección", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } catch (Exception ex) { MessageBox.Show("Error: ", ex.Message); } }