ListViewItem.ListViewSubItemCollection ListViewItem.ListViewSubItemCollection ListViewItem.ListViewSubItemCollection ListViewItem.ListViewSubItemCollection Class

定義

表示 ListViewItem.ListViewSubItem 中儲存的 ListViewItem 物件集合。Represents a collection of ListViewItem.ListViewSubItem objects stored in a ListViewItem.

public: ref class ListViewItem::ListViewSubItemCollection : System::Collections::IList
public class ListViewItem.ListViewSubItemCollection : System.Collections.IList
type ListViewItem.ListViewSubItemCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public Class ListViewItem.ListViewSubItemCollection
Implements IList
繼承
ListViewItem.ListViewSubItemCollectionListViewItem.ListViewSubItemCollectionListViewItem.ListViewSubItemCollectionListViewItem.ListViewSubItemCollection
實作

備註

ListViewItem.ListViewSubItemCollection儲存ListViewItem ListView物件, 代表控制項中父系的子項目。 ListViewItem.ListViewSubItemA ListViewItem.ListViewSubItemCollection stores ListViewItem.ListViewSubItem objects that represent subitems of a parent ListViewItem in the ListView control. ListView當控制項的Columns屬性View ListView Details中指定了資料行, 且控制項的屬性設定為時, 子集合才會顯示在控制項中。 ListViewSubitems are only displayed in a ListView control when columns are specified in the Columns property of the ListView control and when the View property of the ListView control is set to Details. ListViewItem.ListViewSubItemCollection的子工作順序會決定子工作顯示ListView在控制項中的資料行。The order of subitems in the ListViewItem.ListViewSubItemCollection determines the columns the subitems are displayed in the ListView control.

有數種方式可以將子工作加入至集合。There are a number of ways to add subitems to the collection. 方法會將單一ListViewItem.ListViewSubItem新增至集合。 AddThe Add method adds a single ListViewItem.ListViewSubItem to the collection. 若要在集合中加入一些子工作, 您可以建立物件的ListViewItem.ListViewSubItem陣列, 並將它傳遞AddRange給方法。To add a number of subitems to the collection, you create an array of ListViewItem.ListViewSubItem objects and pass it to the AddRange method. 如果您想要在集合中的特定位置插入子項, 可以使用Insert方法。If you want to insert a subitem at a specific location in the collection, you can use the Insert method. 若要移除子項, 您可以使用Remove方法RemoveAt或方法 (如果您知道子工作位於集合中的位置)。To remove subitems, you can use either the Remove method or the RemoveAt method if you know where the subitem is located in the collection. 方法可讓您從集合中移除所有子工作, 而不是Remove使用方法一次移除單一子項。 ClearThe Clear method enables you to remove all subitems from the collection instead of using the Remove method to remove a single subitem at a time.

除了用來加入和移除子項的方法和屬性之外ListViewItem.ListViewSubItemCollection , 也會提供在集合中尋找子工作的方法。In addition to methods and properties for adding and removing subitems, the ListViewItem.ListViewSubItemCollection also provides methods to find subitems in the collection. 方法可讓您判斷ListViewItem.ListViewSubItem是否為集合的成員。 ContainsThe Contains method enables you to determine whether a ListViewItem.ListViewSubItem is a member of the collection. 一旦您知道子項位於集合中, 您就可以使用IndexOf方法來判斷子工作位於集合中的位置。Once you know that the subitem is located in the collection, you can use the IndexOf method to determine where the subitem is located in the collection.

建構函式

ListViewItem.ListViewSubItemCollection(ListViewItem) ListViewItem.ListViewSubItemCollection(ListViewItem) ListViewItem.ListViewSubItemCollection(ListViewItem) ListViewItem.ListViewSubItemCollection(ListViewItem)

初始化 ListViewItem.ListViewSubItemCollection 類別的新執行個體。Initializes a new instance of the ListViewItem.ListViewSubItemCollection class.

屬性

Count Count Count Count

取得集合中的子項目數目。Gets the number of subitems in the collection.

IsReadOnly IsReadOnly IsReadOnly IsReadOnly

取得值,表示集合是否為唯讀。Gets a value indicating whether the collection is read-only.

Item[Int32] Item[Int32] Item[Int32] Item[Int32]

取得或設定集合中位於指定索引處的子項目。Gets or sets the subitem at the specified index within the collection.

Item[String] Item[String] Item[String] Item[String]

從集合中取得具有指定索引鍵的項目。Gets an item with the specified key from the collection.

方法

Add(ListViewItem+ListViewSubItem) Add(ListViewItem+ListViewSubItem) Add(ListViewItem+ListViewSubItem) Add(ListViewItem+ListViewSubItem)

將現有的 ListViewItem.ListViewSubItem 加入至集合。Adds an existing ListViewItem.ListViewSubItem to the collection.

Add(String) Add(String) Add(String) Add(String)

利用指定文字將子項目加入至集合中。Adds a subitem to the collection with specified text.

Add(String, Color, Color, Font) Add(String, Color, Color, Font) Add(String, Color, Color, Font) Add(String, Color, Color, Font)

使用指定文字、前景色彩、背景色彩和字型的設定,將子項目加入至集合中。Adds a subitem to the collection with specified text, foreground color, background color, and font settings.

AddRange(ListViewItem+ListViewSubItem[]) AddRange(ListViewItem+ListViewSubItem[]) AddRange(ListViewItem+ListViewSubItem[]) AddRange(ListViewItem+ListViewSubItem[])

ListViewItem.ListViewSubItem 物件陣列加入集合。Adds an array of ListViewItem.ListViewSubItem objects to the collection.

AddRange(String[]) AddRange(String[]) AddRange(String[]) AddRange(String[])

根據陣列建立新的子項目並加入至集合中。Creates new subitems based on an array and adds them to the collection.

AddRange(String[], Color, Color, Font) AddRange(String[], Color, Color, Font) AddRange(String[], Color, Color, Font) AddRange(String[], Color, Color, Font)

根據陣列建立新的子項目,並使用指定的前景色彩、背景色彩和字型加入至集合中。Creates new subitems based on an array and adds them to the collection with specified foreground color, background color, and font.

Clear() Clear() Clear() Clear()

移除集合中的所有子項目和父 ListViewItemRemoves all subitems and the parent ListViewItem from the collection.

Contains(ListViewItem+ListViewSubItem) Contains(ListViewItem+ListViewSubItem) Contains(ListViewItem+ListViewSubItem) Contains(ListViewItem+ListViewSubItem)

判斷指定的子項目是否位於集合中。Determines whether the specified subitem is located in the collection.

ContainsKey(String) ContainsKey(String) ContainsKey(String) ContainsKey(String)

判斷集合是否包含具有指定索引鍵的項目。Determines if the collection contains an item with the specified key.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetEnumerator() GetEnumerator() GetEnumerator() GetEnumerator()

傳回用於逐一查看子項目集合的列舉程式。Returns an enumerator to use to iterate through the subitem collection.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
IndexOf(ListViewItem+ListViewSubItem) IndexOf(ListViewItem+ListViewSubItem) IndexOf(ListViewItem+ListViewSubItem) IndexOf(ListViewItem+ListViewSubItem)

傳回指定子項目集合中的索引。Returns the index within the collection of the specified subitem.

IndexOfKey(String) IndexOfKey(String) IndexOfKey(String) IndexOfKey(String)

傳回具有指定索引鍵之項目在集合中第一次出現的索引。Returns the index of the first occurrence of an item with the specified key within the collection.

Insert(Int32, ListViewItem+ListViewSubItem) Insert(Int32, ListViewItem+ListViewSubItem) Insert(Int32, ListViewItem+ListViewSubItem) Insert(Int32, ListViewItem+ListViewSubItem)

將子項目插入位於指定索引處的集合中。Inserts a subitem into the collection at the specified index.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
Remove(ListViewItem+ListViewSubItem) Remove(ListViewItem+ListViewSubItem) Remove(ListViewItem+ListViewSubItem) Remove(ListViewItem+ListViewSubItem)

從集合中移除指定的項目。Removes a specified item from the collection.

RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32) RemoveAt(Int32)

移除集合中位於指定索引處的子項目。Removes the subitem at the specified index within the collection.

RemoveByKey(String) RemoveByKey(String) RemoveByKey(String) RemoveByKey(String)

從集合中移除具有指定索引鍵的項目。Removes an item with the specified key from the collection.

ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)

明確介面實作

ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32) ICollection.CopyTo(Array, Int32)

將此項目和子項目的集合複製到陣列中。Copies the item and collection of subitems into an array.

ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized ICollection.IsSynchronized

取得值,表示是否同步化存取集合 (執行緒安全)。Gets a value indicating whether access to the collection is synchronized (thread safe).

ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot ICollection.SyncRoot

取得物件,這個物件可以用來對集合進行同步存取。Gets an object that can be used to synchronize access to the collection.

IList.Add(Object) IList.Add(Object) IList.Add(Object) IList.Add(Object)

將現有的 ListViewItem.ListViewSubItem 加入至集合。Adds an existing ListViewItem.ListViewSubItem to the collection.

IList.Contains(Object) IList.Contains(Object) IList.Contains(Object) IList.Contains(Object)

判斷指定的子項目是否位於集合中。Determines whether the specified subitem is located in the collection.

IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object) IList.IndexOf(Object)

傳回指定子項目集合中的索引。Returns the index within the collection of the specified subitem.

IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object) IList.Insert(Int32, Object)

將子項目插入位於指定索引處的集合中。Inserts a subitem into the collection at the specified index.

IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize IList.IsFixedSize

取得值,這個值表示集合的大小是否是固定的。Gets a value indicating whether the collection has a fixed size.

IList.Item[Int32] IList.Item[Int32] IList.Item[Int32] IList.Item[Int32]

取得或設定集合內位於指定索引處的 ListViewItem.ListViewSubItemGets or sets the ListViewItem.ListViewSubItem at the specified index within the collection.

IList.Remove(Object) IList.Remove(Object) IList.Remove(Object) IList.Remove(Object)

從集合中移除指定的項目。Removes a specified item from the collection.

擴充方法

Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable) Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。Casts the elements of an IEnumerable to the specified type.

OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable) OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。Filters the elements of an IEnumerable based on a specified type.

AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable) AsParallel(IEnumerable)

啟用查詢的平行化作業。Enables parallelization of a query.

AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable) AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryableConverts an IEnumerable to an IQueryable.

適用於

另請參閱