我用一个函数改变shape数组的位置,程序是这样的:Private Sub Form_Click() shapeselect Shape1() End SubPrivate Sub shapeselect(shapeC() As Shape) For i = 1 To 4 shapeC(i).Shape = i Next End Sub错误为:缺少数组或用户定义类型
Private Sub Command1_Click() SetCaption Shape1 End SubPrivate Sub shapeselect(shapeC As Object) Dim i As Long For i = 0 To 3 shapeC(i).Caption = i Next i End Sub
Private Sub Command1_Click() SetCaption Shape1 End SubPrivate function SetCaption(byref shape as variant) dim i as integer for i=0 to shape.count-1 shape(1).top=11
shapeselect Shape1()
End SubPrivate Sub shapeselect(shapeC() As Shape)
For i = 1 To 4
shapeC(i).Shape = i
Next
End Sub错误为:缺少数组或用户定义类型
SetCaption Shape1
End SubPrivate Sub shapeselect(shapeC As Object)
Dim i As Long
For i = 0 To 3
shapeC(i).Caption = i
Next i
End Sub
SetCaption Shape1
End SubPrivate function SetCaption(byref shape as variant)
dim i as integer
for i=0 to shape.count-1
shape(1).top=11
next i
End Sub