public void buscaPergunta() { Pergunta pergunta = new Pergunta(); DaoPergunta dao = new DaoPergunta(); int valor = 0; pergunta.IdNivel = dao.escolheNivel(valor); // while(pergunta.IdNivel != nivel) pergunta = dao.retornaPergunta(pergunta); rtbDescri.Text = pergunta.PergDescri; pergunta = dao.retornaPergunta(pergunta); }
private void btnInicio_Click(object sender, EventArgs e) { int nivel = 0; if (rb_1.Checked == true) { nivel = 1; } else if (rb_2.Checked == true) { nivel = 2; } else { nivel = 3; } DaoPergunta dao = new DaoPergunta(); dao.escolheNivel(nivel); try { //Esconda o formulario atual this.Hide(); // Crie apenas o segundo form FrmNovoJogo frmNovoJogo = new FrmNovoJogo(); //Mostre o segundo form frmNovoJogo.ShowDialog(); } finally { // ao fechar, mostre novamente o inicial, ou feche this.Close(); this.Show(); } }