循环的问题
如题: 程序运行在标签中显示正常Dim season(0 To 3) As String
Dim sale(0 To 3) As String
Private Sub Combo1_Click()
Label1.Caption = Combo1.Text & " " & sale(Combo1.ListIndex)
End Sub
Private Sub Form_Load()
Dim i
AutoSize = True
season(0) = "春季": season(1) = "夏季": season(2) = "秋季": season(3) = "冬季"
sale(0) = "1234": sale(1) = "2345": sale(2) = "3456": sale(3) = "4567"
For i = 0 To 3
Combo1.AddItem season(i)
Next i
Combo1.ListIndex = 0 ' 显示列表中的第一项
End Sub
问题是:
For i = 0 To 3
Combo1.AddItem season(i)
Next i
而 sale(0 To 3)并没有在循环中参加
为什么能同步显示 sale(0 To 3)
谢谢