用VB开发自己的控件,
我现在只知道用怎么用一些基本或标准的数据类型作为属性
如:
  Property Get Color As OLE_COLOR
     Color = m_Color
  End Property  Property Get Caption As String
     Caption = m_Caption
  End Property但是不知道数组属性应该怎么做,谢谢!

解决方案 »

  1.   

    应该给定义一个集合对象保存list中的值
    private ListCols as Collection
      

  2.   

    object[(number)].Index
    控件数组
    object 对象表达式,其值是“应用于”列表中的一个对象。 
    number 整数值的数值表达式,用来标识控件数组中的一个控件。 不知道这个是不是你要得。
      

  3.   

    参考如下:
    1、类Test代码:
    Private list() As String  '设置列表属性Public Sub Add(str As String)
    Dim i As Integer
    i = UBound(list)
    list(i) = str
    ReDim Preserve list(1 To i + 1)
    End SubPublic Function getItem(index As Integer) As String
      If index > UBound(list) Then
       getItem = ""
      Else
       getItem = list(index)
      End If
    End FunctionPrivate Sub Class_Initialize()
    ReDim Preserve list(1 To 1)
    End SubPublic Function GetCount() As Integer
      GetCount = UBound(list) - 1
    End Function2、窗体测试代码
    Dim a As New Test
    a.Add "myh"
    a.Add "Gyp"
    MsgBox a.getItem(1) + str(a.GetCount)