private void btnProfessor_Click(object sender, EventArgs e) { this.Hide(); FormProfessor formProfessor = new FormProfessor(); formProfessor.Show(); }
private void gridProfessor_CellContentClick(object sender, DataGridViewCellEventArgs e) { DataGridView dgv = sender as DataGridView; prof.idProfessor = Convert.ToInt32(dgv.CurrentRow.Cells[0].Value.ToString()); prof.nome = dgv.CurrentRow.Cells[1].Value.ToString(); prof.idade = Convert.ToInt32(dgv.CurrentRow.Cells[2].Value.ToString()); prof.sexo = Convert.ToChar(dgv.CurrentRow.Cells[3].Value.ToString()); this.Hide(); FormProfessor formProfessor = new FormProfessor(prof); formProfessor.Show(); }