private void btnAluno_Click(object sender, EventArgs e) { this.Hide(); FormAluno formAluno = new FormAluno(); formAluno.Show(); }
private void gridAluno_CellContentClick(object sender, DataGridViewCellEventArgs e) { DataGridView dgv = sender as DataGridView; aluno.idAluno = Convert.ToInt32(dgv.CurrentRow.Cells[0].Value.ToString()); aluno.nome = dgv.CurrentRow.Cells[1].Value.ToString(); aluno.idade = Convert.ToInt32(dgv.CurrentRow.Cells[2].Value.ToString()); aluno.sexo = Convert.ToChar(dgv.CurrentRow.Cells[3].Value.ToString()); this.Hide(); FormAluno formAluno = new FormAluno(aluno); formAluno.Show(); }