可以利用Split函数来比较方便地实现类似功能, 比如:Private Sub Form_Load() Dim ALabel() As String Dim iLoop As Integer ALabel = Split("Label1,Label2,label3,Label4,Label5", ",") For iLoop = LBound(ALabel) To UBound(ALabel) LabelArray(iLoop).Caption = ALabel(iLoop) Next iLoop End Sub
Dim ALabel() As String
Dim iLoop As Integer
ALabel = Split("Label1,Label2,label3,Label4,Label5", ",")
For iLoop = LBound(ALabel) To UBound(ALabel)
LabelArray(iLoop).Caption = ALabel(iLoop)
Next iLoop
End Sub