如何在activeX中添加collenction属性
yue 2001-03-01 02:04:00 我想在activeX中建立一个类似list的属性,可以通过add添加值,创建类的代码如下:
Public Property Get ItemList() As Collection
Dim i As Integer
For i = 1 To UBound(m_Item)
ItemList.Add m_Item(i)
Next i
End Property
Public Property Let ItemList(ByVal vNewValue As Variant)
ReDim Preserve m_Item(UBound(m_Item) + 1)
m_Item(UBound(m_Item)) = vNewValue
End Property
调用类的代码如下:
Set mbar = New LibBar.clsBarPrint
mbar.ItemList.Add "1"
出现出错提示:“对象变量或 With 块变量未设置”
请问该如何解决?