private void button3_Click(object sender, EventArgs e) { int pos = 0; try { pos = dataGridView1.CurrentCell.RowIndex; int idPrueba = (int)dataGridView1[0, pos].Value; ResultadosCandidatos rc = new ResultadosCandidatos(idPrueba, this); rc.MdiParent = this.MdiParent; rc.Show(); this.Hide(); } catch { MessageBox.Show("Primero seleccione a alguien de la tabla"); } }