0
変数を入れてしまったので、私は= 3と言っていますが、それは質問には進まず、何をすべきか分かりません。私は上がるが質問はしない。 私はこれで非常に悪いかもしれないが、なぜ5秒前にそれが働いたのか、なぜ今はないのか。なぜ変数が上がらないのですか
Public Class Test1
Dim question(3, 5) As String
Dim i As Integer = 2
Dim correctanswear = 0
Dim a As Integer = 0
Private Sub Test1_Load()
question(1, 0) = "2+2="
question(1, 1) = "1"
question(1, 2) = "2"
question(1, 3) = "3"
question(1, 4) = "4"
question(2, 0) = "How old are you?"
question(2, 1) = "12"
question(2, 2) = "13"
question(2, 3) = "18"
question(2, 4) = "17"
question(3, 0) = "7+14="
question(3, 1) = "23"
question(3, 2) = "21"
question(3, 3) = "34"
question(3, 4) = "22"
Label1.Text = question(i - 1, 0)
nr1.Text = question(i - 1, 1)
nr2.Text = question(i - 1, 2)
nr3.Text = question(i - 1, 3)
nr4.Text = question(i - 1, 4)
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
Test1_Load()
Button5.Hide()
Button2.Visible = "True"
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Hide()
MainMenu.Show()
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
If a > 3 Then
MessageBox.Show("You answered " + correctanswear.ToString() + " questions correctly.")
Else
If i = 2 AndAlso nr4.Checked = True Then
correctanswear += 1
MessageBox.Show("You answered " + correctanswear.ToString() + " questions correctly.")
i = i + 1
MessageBox.Show(i)
ElseIf i = 3 AndAlso nr3.Checked Then
correctanswear += 1
MessageBox.Show("You answered " + correctanswear.ToString() + " questions correctly.")
i = i + 1
MessageBox.Show(i)
End If
If i = 4 AndAlso nr2.Checked = True Then
MessageBox.Show(i)
correctanswear += 1
MessageBox.Show("You answered " + correctanswear.ToString() + " questions correctly.")
Button2.Hide()
Button5.Text = "Retake the test"
Button5.Show()
End If
End If
a = a + 1
End Sub
エンドクラス
ラベルに何が表示されているか、代わりに表示される内容を説明してください。 – Steve
は2 + 2 =のままです。メッセージボックスにはi = 3と表示され、質問は変わるはずです。 – Axel8017