Advertisement
ManuMaloka

Tarefa_20

May 25th, 2023 (edited)
918
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Class Form1
  2.     Dim xmatriz(2, 3) As Integer
  3.     Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
  4.  
  5.     End Sub
  6.  
  7.     Private Sub GroupBox4_Enter(sender As Object, e As EventArgs) Handles GroupBox4.Enter
  8.  
  9.     End Sub
  10.  
  11.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  12.         GroupBox2.Visible = True
  13.     End Sub
  14.  
  15.     Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
  16.         GroupBox2.Visible = False
  17.         GroupBox1.Visible = True
  18.  
  19.         RadioButton4.Checked = False
  20.         RadioButton5.Checked = False
  21.         RadioButton6.Checked = False
  22.     End Sub
  23.  
  24.     Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  25.         GroupBox3.Visible = False
  26.         GroupBox2.Visible = True
  27.  
  28.         RadioButton7.Checked = False
  29.         RadioButton8.Checked = False
  30.         RadioButton9.Checked = False
  31.  
  32.         Button5.Visible = False
  33.         PictureBox5.Visible = False
  34.  
  35.     End Sub
  36.  
  37.     Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
  38.         End
  39.     End Sub
  40.  
  41.     Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
  42.         Dim i, xcorrectas As Integer
  43.  
  44.         xcorrectas = 0
  45.         For i = 1 To 3
  46.             If xmatriz(1, i) = xmatriz(2, i) Then
  47.                 xcorrectas = xcorrectas + 1
  48.             End If
  49.         Next i
  50.         MsgBox("Acertou" & Str(xcorrectas) & " perguntas.", 64, "Resultado")
  51.         GroupBox1.Visible = False
  52.         GroupBox2.Visible = False
  53.         GroupBox3.Visible = False
  54.  
  55.     End Sub
  56.  
  57.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  58.         GroupBox3.Visible = True
  59.     End Sub
  60.  
  61.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  62.         xmatriz(1, 1) = 3
  63.         xmatriz(1, 2) = 1
  64.         xmatriz(1, 3) = 2
  65.         xmatriz(2, 1) = 0
  66.         xmatriz(2, 2) = 0
  67.         xmatriz(2, 3) = 0
  68.  
  69.  
  70.     End Sub
  71.     Private Sub Form1_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
  72.         RadioButton1.Checked = False
  73.         RadioButton2.Checked = False
  74.         RadioButton3.Checked = False
  75.         Button1.Visible = False
  76.  
  77.     End Sub
  78.     Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
  79.         xmatriz(2, 1) = 1
  80.         Button1.Visible = True
  81.     End Sub
  82.  
  83.     Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged
  84.         xmatriz(2, 1) = 2
  85.         Button1.Visible = True
  86.     End Sub
  87.  
  88.     Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton3.CheckedChanged
  89.         xmatriz(2, 1) = 3
  90.         Button1.Visible = True
  91.     End Sub
  92.  
  93.     Private Sub RadioButton6_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton6.CheckedChanged
  94.         xmatriz(2, 2) = 1
  95.         Button2.Visible = True
  96.     End Sub
  97.  
  98.     Private Sub RadioButton5_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton5.CheckedChanged
  99.         xmatriz(2, 2) = 2
  100.         Button2.Visible = True
  101.     End Sub
  102.  
  103.     Private Sub RadioButton4_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton4.CheckedChanged
  104.         xmatriz(2, 2) = 3
  105.         Button2.Visible = True
  106.     End Sub
  107.  
  108.     Private Sub RadioButton9_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton9.CheckedChanged
  109.         xmatriz(2, 3) = 1
  110.  
  111.         Button5.Visible = True
  112.         PictureBox5.Visible = True
  113.  
  114.     End Sub
  115.  
  116.     Private Sub RadioButton8_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton8.CheckedChanged
  117.         xmatriz(2, 3) = 2
  118.  
  119.         Button5.Visible = True
  120.         PictureBox5.Visible = True
  121.     End Sub
  122.  
  123.     Private Sub RadioButton7_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton7.CheckedChanged
  124.         xmatriz(2, 3) = 3
  125.  
  126.         Button5.Visible = True
  127.         PictureBox5.Visible = True
  128.     End Sub
  129.  
  130.     Private Sub Label3_Click(sender As Object, e As EventArgs) Handles Label3.Click
  131.  
  132.     End Sub
  133.  
  134.     Private Sub PictureBox5_Click(sender As Object, e As EventArgs) Handles PictureBox5.Click
  135.         Dim i, xcorrectas As Integer
  136.  
  137.         xcorrectas = 0
  138.         For i = 1 To 3
  139.             If xmatriz(1, i) = xmatriz(2, i) Then
  140.                 xcorrectas = xcorrectas + 1
  141.             End If
  142.         Next i
  143.         MsgBox("Acertou" & Str(xcorrectas) & " perguntas.", 64, "Resultado")
  144.         GroupBox1.Visible = False
  145.         GroupBox2.Visible = False
  146.         GroupBox3.Visible = False
  147.     End Sub
  148.  
  149.     Private Sub PictureBox4_Click(sender As Object, e As EventArgs) Handles PictureBox4.Click
  150.         End
  151.     End Sub
  152. End Class
  153.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement