vb6.0 Label10(10)标签的二维数组问题!!!
发布网友
发布时间:2022-04-25 21:07
我来回答
共2个回答
热心网友
时间:2022-06-17 12:19
呵呵,给你个小提示
Private Sub Command1_Click()
Dim i As Integer, j As Integer
For i = 1 To 10
For j = 1 To 50
Print Controls("Label" & i)(j).Caption
Next
Next
End Sub
相信你能明白!
热心网友
时间:2022-06-17 12:20
用变量表示控件
Dim a(1 To 5, 1 To 10) As Label
Private Sub Form_Load()
Set a(1, 1) = Label10(1)
Set a(1, 2) = Label10(2)
...
Set a(2, 1) = Label10(6)
Set a(2, 2) = Label10(7)
End Sub
这样就可以了
方法就是这样,几百个用循环赋值就可以,掌握好循环变量之间的关系