VBA类模块能用数组作属性吗
我做了个类模块CBOX,代码如下OptionExplicitPrivatepHeightAsIntegerPublicPropertyGetHeight()AsInteg...
我做了个类模块CBOX,代码如下
Option Explicit
Private pHeight As Integer
Public Property Get Height() As Integer()
Height = pHeight
End Property
Public Property Let Height(H() As Integer) pHeight = H
End Property
标准模块如下:
Dim Unit As CBox
Set Unit = New CBox
Unit.Height = Array(11, 22, 33)
Debug.Print Unit.Height(1)
为何总是出错啊,哪位大师帮忙改正一下啊,谢谢了 展开
Option Explicit
Private pHeight As Integer
Public Property Get Height() As Integer()
Height = pHeight
End Property
Public Property Let Height(H() As Integer) pHeight = H
End Property
标准模块如下:
Dim Unit As CBox
Set Unit = New CBox
Unit.Height = Array(11, 22, 33)
Debug.Print Unit.Height(1)
为何总是出错啊,哪位大师帮忙改正一下啊,谢谢了 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询