如果想要直接传递窗体上的控件数组,你的过程参数必须是集合形式:
call other(Frame1)
Sub other(My_frame As Collection)
My_frame(0).BackColor = vbGreen
My_frame(1).BackColor = vbRed
End Sub
Private Sub Form_Load()
Dim a(3) As Frame
For i = 0 To UBound(a)
Set a(i) = Frame1(i)
Next
Call other(a)
End Sub
Sub other(My_frame() As Frame)
My_frame(0).BackColor = vbGreen
My_frame(1).BackColor = vbRed
My_frame(2).BackColor = vbBlue
End Sub