先生成偶数序列的数组,然后用for each遍历数组。
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim a%(9), i%, context$
Dim x As VariantType
For i = 0 To 9
a(i) = i * 2
Next i
context = ""
For Each x In a
context = context & x & " "
Next
Label1.Text = context
End Sub
End Class