我无法更改标签中的文字。有人能告诉我问题在哪里吗?
Public Class Form1
Dim Tracker As Integer = 0
Dim Questions(10) As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
Questions(0) = "Are you mad?"
Questions(1) = "Are you sad?"
Questions(2) = "Are you glad?"
Questions(3) = "Are you happy?"
Questions(4) = "Are you indebted?"
Questions(5) = "Are you swimming in money?"
Questions(6) = "Do you play sports?"
Questions(7) = "Do you watch SportsCenter?"
Questions(8) = "Do you cheer for the Pistons?"
Questions(9) = "Do you cheer for the Lions?"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
Button1.Text = "Next"
For i = 0 To Questions.Length - 1
Label1.Text += Questions(i)
Next
End Sub
End Class
答案 0 :(得分:1)
我只是使用按钮单击来增加计数器变量,然后将该变量设置为数组索引。