Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Dim xmatriz(2, 3) As Integer
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- '1º botão anterior
- GroupBox5.Visible = False
- GroupBox4.Visible = True
- RadioButton4.Checked = False
- RadioButton5.Checked = False
- RadioButton6.Checked = False
- End Sub
- Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
- '2º botão anterior
- GroupBox6.Visible = False
- GroupBox5.Visible = True
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- '1º botão seguinte
- GroupBox5.Visible = True
- Button3.Visible = False
- End Sub
- Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
- '2º botão seguinte
- GroupBox6.Visible = True
- End Sub
- Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
- 'inicializar a matriz
- xmatriz(1, 1) = 3
- xmatriz(1, 2) = 1
- xmatriz(1, 3) = 2
- xmatriz(2, 1) = 0
- xmatriz(2, 2) = 0
- xmatriz(2, 3) = 0
- End Sub
- 'resposta 1
- Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
- xmatriz(2, 1) = 1
- Button1.Visible = True
- End Sub
- 'resposta 1
- Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged
- xmatriz(2, 1) = 2
- Button1.Visible = True
- End Sub
- 'resposta 1
- Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton3.CheckedChanged
- xmatriz(2, 1) = 3
- Button1.Visible = True
- End Sub
- 'resposta 2
- Private Sub RadioButton4_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton4.CheckedChanged
- xmatriz(2, 2) = 1
- Button3.Visible = True
- End Sub
- 'resposta 2
- Private Sub RadioButton5_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton5.CheckedChanged
- xmatriz(2, 2) = 2
- Button3.Visible = True
- End Sub
- 'resposta 2
- Private Sub RadioButton6_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton6.CheckedChanged
- xmatriz(2, 2) = 3
- Button3.Visible = True
- End Sub
- 'resposta 3
- Private Sub RadioButton7_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton7.CheckedChanged
- xmatriz(2, 3) = 1
- RadioButton7.Checked = False
- RadioButton8.Checked = False
- RadioButton9.Checked = False
- End Sub
- 'resposta 3
- Private Sub RadioButton8_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton8.CheckedChanged
- xmatriz(2, 3) = 2
- End Sub
- 'resposta 3
- Private Sub RadioButton9_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton9.CheckedChanged
- xmatriz(2, 3) = 3
- End Sub
- Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
- ' Contagem das respostas corretas
- Dim i, xcorretas As Integer
- xcorretas = 0
- For i = 1 To 3
- If xmatriz(1, i) = xmatriz(2, i) Then
- xcorretas = xcorretas + 1
- End If
- Next i
- MsgBox("Acertou" & Str(xcorretas) & " perguntas.", 64, "Resultado")
- GroupBox4.Visible = False
- GroupBox5.Visible = False
- GroupBox6.Visible = False
- End Sub
- Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
- 'Botão sair
- Application.Exit()
- End Sub
- Private Sub PictureBox5_Click(sender As Object, e As EventArgs) Handles PictureBox5.Click
- ' Contagem das respostas corretas
- Dim i, xcorretas As Integer
- xcorretas = 0
- For i = 1 To 3
- If xmatriz(1, i) = xmatriz(2, i) Then
- xcorretas = xcorretas + 1
- End If
- Next i
- MsgBox("Acertou" & Str(xcorretas) & " perguntas.", 64, "Resultado")
- GroupBox4.Visible = False
- GroupBox5.Visible = False
- GroupBox6.Visible = False
- End Sub
- Private Sub PictureBox6_Click(sender As Object, e As EventArgs) Handles PictureBox6.Click
- 'Botão sair
- Application.Exit()
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement