Collection对象问题

三断笛 2008-11-09 07:51:39
编写一个集合类,类包含Add,Remove,Count,Item等属性和方法
问题是:如何对Item进行操作

下面的方法能读Item,要怎样才能写Item呢?
private c_Item() as variant
'''''读Item
public property get Item(Index As Long) as Variant
Item(index)=c_Item(Index)
End Property
''''读Item
Public Function Item(Index As Long) As Variant
Item=c_Item(Index)
End Function

如何实现像Collection对象的Item一样进行写操作?
...全文
141 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
cqsxdb 2008-11-09
  • 打赏
  • 举报
回复
up
三断笛 2008-11-09
  • 打赏
  • 举报
回复
已解决
public property get Item(Index As Long) as Variant
Item(index)=c_Item(Index)
End Property

public property let item(index as long ,value as variant)
c_item(index)=value
end property

864

社区成员

发帖
与我相关
我的任务
社区描述
VB COM/DCOM/COM+
c++ 技术论坛(原bbs)
社区管理员
  • COM/DCOM/COM+社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧