| public class ListBoxEx : ListBox {…} |
| public class ListBoxExItem {…} |
| public class ListBoxExItemCollection : IList, ICollection, IEnumerator {} //这个类相对于标准ListBox中的ObjectCollection,这个类作为ListBoxEx中的Items属性的类型 www.jc567.cn public class SelectedListBoxExItemCollection : : IList, ICollection, IEnumerator{} //这个类相对于标准ListBox中的SelectedObjectCollection,这个类作为ListBoxEx中的SelectedItems属性的类型 |
| public void Remove(ListBoxExItem item) { this._Items.Remove(item); //_Items为ObjectCollection类型 } public void Insert(int index, ListBoxExItem item) { this._Items.Insert(index, item); } public int Add(ListBoxExItem item) { return this._Items.Add(item); } |
| private ObjectCollection _Items; public ListBoxExItemCollection(ObjectCollection baseItems) { this._Items = baseItems; } |