private void btnAgregar_Click(object sender, EventArgs e) { EditaAdmin frm = new EditaAdmin(this); frm.Show(); this.Visible = false; verDatos(); }
private void btnEditar_Click(object sender, EventArgs e) { try { if (tblTabla.CurrentRow != null) { usuario = this.tblTabla.CurrentRow.Cells[0].Value.ToString(); EditaAdmin frm = new EditaAdmin(this, usuario); 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); } }