Public Class CollectionA
    Inherits CollectionBase    Default Public Property Item(ByVal index As Integer) As MyItem
        Get
            Return List(index)
        End Get
        Set(ByVal Value As MyItem)
            List(index) = Value
        End Set
    End Property
End Class

解决方案 »

  1.   

    public class CollectionA : CollectionBase
    {
      public MyItem this [ int index ]
      {
        get { return List[index]; }
        set { List[index] = value;}
      }
    }
      

  2.   

    还有一个问题啦~是不是List需要定义一下呢?因为下面的代码里面还用到了List.Add(vMyItem);可是我却在方法列表里找不到~我该怎么定义呢?
    这样对吗?
    private RSSItem[] List = new RSSItem();还是
    private Array List = new RSSItem();我怎么改才能让这个列表可以使用呢??
      

  3.   

    根据你的描述来看,List极有可能是ArrayList。private System.Collections.ArrayList List = new System.Collections.ArrayList();
      

  4.   

    我的这个RSSItem是一个结构体呀~也没有办法使用IList接口。这个怎么办呢?
      

  5.   

    嗯,Ivony兄说的是对的~我已经顺利改完了这一段代码。VS没有提示错误信息。呵呵~谢谢~