ListBox.ObjectCollection 成员
代表 ListBox 中项的集合。
下表列出了由 ListBox.ObjectCollection 类型公开的成员。
公共构造函数
名称 | 说明 | |
---|---|---|
ListBox.ObjectCollection | 已重载。初始化 ListBox.ObjectCollection 的新实例。 |
页首
公共属性
名称 | 说明 | |
---|---|---|
Count | 获取集合中项的数目。 | |
IsReadOnly | 获取一个值,该值指示集合是否为只读。 | |
Item | 获取或设置集合中指定索引处的项。 |
页首
公共方法
(请参见 受保护的方法 )
名称 | 说明 | |
---|---|---|
Add | 向 ListBox 的项列表添加项。 | |
AddRange | 已重载。 向 ListBox 的项列表添加一组项。 | |
Clear | 从集合中移除所有项。 | |
Contains | 确定指定的项是否位于集合内。 | |
CopyTo | 将整个集合复制到现有对象的数组中,从该数组内的指定位置开始复制。 | |
Equals | 已重载。 确定两个 Object 实例是否相等。 (从 Object 继承。) | |
GetEnumerator | 返回一个枚举数,将使用该枚举数循环访问项集合。 | |
GetHashCode | 用作特定类型的哈希函数。GetHashCode 适合在哈希算法和数据结构(如哈希表)中使用。 (从 Object 继承。) | |
GetType | 获取当前实例的 Type。 (从 Object 继承。) | |
IndexOf | 返回指定的项在集合中的索引。 | |
Insert | 将项插入列表框的指定索引处。 | |
ReferenceEquals | 确定指定的 Object 实例是否是相同的实例。 (从 Object 继承。) | |
Remove | 从集合中移除指定的对象。 | |
RemoveAt | 移除集合中指定索引处的项。 | |
ToString | 返回表示当前 Object 的 String。 (从 Object 继承。) |
页首
受保护的方法
名称 | 说明 | |
---|---|---|
Finalize | 允许 Object 在“垃圾回收”回收 Object 之前尝试释放资源并执行其他清理操作。 (从 Object 继承。) | |
MemberwiseClone | 创建当前 Object 的浅表副本。 (从 Object 继承。) |
页首
显式接口实现
名称 | 说明 | |
---|---|---|
System.Collections.ICollection.CopyTo | 将集合的元素复制到一个数组中,从特定的数组索引开始。 | |
System.Collections.IList.Add | 将对象添加到 ListBox 类中。 | |
System.Collections.ICollection.IsSynchronized | 有关此成员的说明,请参见 ICollection.IsSynchronized。 | |
System.Collections.ICollection.SyncRoot | 有关此成员的说明,请参见 ICollection.SyncRoot。 | |
System.Collections.IList.IsFixedSize | 有关此成员的说明,请参见 IList.IsFixedSize。 |
页首
请参见
参考
ListBox.ObjectCollection 类
System.Windows.Forms 命名空间
ListBox.SelectedObjectCollection
ListBox.SelectedIndexCollection