我必须做一个问答游戏。我需要转移测验()。正确的号码。我试图使用索引作为我可以传输的数字以使其工作,但它不起作用。
ElseIf IntQ = 9 Then
Quiz(8).Question = "On what channel did __________ first air?"
Quiz(8).Ans1 = "BBC"
Quiz(8).Ans2 = "BBC One"
Quiz(8).Ans3 = "BBC Two"
Quiz(8).Correct = 2
Quiz(8).Used = False
lblprompt.Text = Quiz(8).Question
lblAnswer1.Text = Quiz(8).Ans1
lblAnswer2.Text = Quiz(8).Ans2
lblAnswer3.Text = Quiz(8).Ans3
index = 8
当您点击标签时会发生这种情况。
Private Sub lblAnswer2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lblAnswer2.Click
Dim quiz(9) As Quiz
If quiz(index).Correct = 2 Then
lblprompt.Text = "CORRECT - You EARNED 2 Bananas"
form1.Extermination += 2
Else
lblprompt.Text = "That is NOT the answer - You LOST 2 BANANAS"
form1.Extermination -= 2
End If
索引不起作用。所以我希望能找到一些事情要做。