ListView.CheckedListViewItemCollection ListView.CheckedListViewItemCollection ListView.CheckedListViewItemCollection ListView.CheckedListViewItemCollection Class

定義

表示清單檢視控制項中之核取項目的集合。Represents the collection of checked items in a list view control.

public: ref class ListView::CheckedListViewItemCollection : System::Collections::IList
[System.ComponentModel.ListBindable(false)]
public class ListView.CheckedListViewItemCollection : System.Collections.IList
type ListView.CheckedListViewItemCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public Class ListView.CheckedListViewItemCollection
Implements IList
繼承
ListView.CheckedListViewItemCollectionListView.CheckedListViewItemCollectionListView.CheckedListViewItemCollectionListView.CheckedListViewItemCollection
屬性
實作

備註

AListView.CheckedListViewItemCollection儲存選取的項目中ListView控制項。A ListView.CheckedListViewItemCollection stores the checked items in a ListView control. 項目才檢查,如果CheckBoxes的屬性ListView控制設為 trueItems can only be checked if the CheckBoxes property of the ListView control is set to true. 項目儲存在ListView.CheckedListViewItemCollection中所包含的項目ListView.ListViewItemCollectionThe items stored in the ListView.CheckedListViewItemCollection are items contained in the ListView.ListViewItemCollection. ListView.ListViewItemCollection類別會儲存所有項目顯示在ListView控制項。The ListView.ListViewItemCollection class stores all items displayed in the ListView control.

下表顯示如何的範例ListView.ListViewItemCollection儲存的項目ListView以及其在範例中的選取項目狀態ListView控制項。The following table shows an example of how the ListView.ListViewItemCollection stores the items of the ListView as well as their selection states in an example ListView control.

索引Index 項目Item 檢查在 ListView 中的狀態Checked state in the ListView
00 Item1Item1 未選取Unchecked
11 Item2Item2 已核取Checked
22 Item3Item3 未選取Unchecked
33 Item4Item4 已核取Checked
44 Item5Item5 已核取Checked

根據ListView.ListViewItemCollection上表中的範例下, 表會示範如何ListView.CheckedListViewItemCollection會出現。Based on the ListView.ListViewItemCollection example in the previous table, the following table demonstrates how the ListView.CheckedListViewItemCollection would appear.

索引Index 簽入 ListViewItemCollection 的項目Checked item in ListViewItemCollection
00 Item2Item2
11 Item4Item4
22 Item5Item5

您可以使用這個類別的方法與屬性來執行各種工作的集合。You can use the properties and methods of this class to perform a variety of tasks with the collection. Contains方法可讓您判斷是否將項目從ListView.ListViewItemCollection類別是隸屬ListView.CheckedListViewItemCollectionThe Contains method enables you to determine whether an item from the ListView.ListViewItemCollection class is a member of the ListView.CheckedListViewItemCollection. 一旦您知道的項目是集合中,您可以使用IndexOf方法,以判斷的位置中的項目ListView.CheckedListViewItemCollectionOnce you know that the item is in the collection, you can use the IndexOf method to determine the position of the item in the ListView.CheckedListViewItemCollection.

建構函式

ListView.CheckedListViewItemCollection(ListView) ListView.CheckedListViewItemCollection(ListView) ListView.CheckedListViewItemCollection(ListView) ListView.CheckedListViewItemCollection(ListView)

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

屬性

Count Count Count Count

取得集合中的項目數目。Gets the number of items 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 the item at the specified index within the collection.

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

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

方法

Contains(ListViewItem) Contains(ListViewItem) Contains(ListViewItem) Contains(ListViewItem)

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

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

判斷具有指定索引鍵的資料行是否包含在集合中。Determines if a column with the specified key is contained in the collection.

CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32) CopyTo(Array, Int32)

將整個集合複製到現有陣列中的指定位置。Copies the entire collection into an existing array at a specified location within the array.

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 that can be used to iterate through the checked item 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) IndexOf(ListViewItem) IndexOf(ListViewItem) IndexOf(ListViewItem)

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

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

判斷具有指定索引鍵之項目的索引。Determines the index for an item with the specified key.

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

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

(Inherited from Object)
ToString() ToString() ToString() ToString()

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

(Inherited from Object)

明確介面實作

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

取得值,這個值表示對 ListView.CheckedListViewItemCollection 的存取是否同步 (安全執行緒)。Gets a value indicating whether access to the ListView.CheckedListViewItemCollection is synchronized (thread safe).

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

取得可用來對控制項集合進行同步 (Synchronize) 存取的物件。Gets an object that can be used to synchronize access to the collection of controls.

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

將項目加入至集合。Adds an item to the collection.

IList.Clear() IList.Clear() IList.Clear() IList.Clear()

移除集合的所有項目。Removes all items from the collection.

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

驗證項目是否已核取。Verifies whether the item is checked.

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

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

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

在指定的索引位置,插入項目至集合之中。Inserts an item into the collection at a 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]

取得或設定集合中的物件。Gets or sets an object from the collection.

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

從集合移除第一個項目。Removes the first occurrence of an item from the collection.

IList.RemoveAt(Int32) IList.RemoveAt(Int32) IList.RemoveAt(Int32) IList.RemoveAt(Int32)

從集合中的指定索引處移除項目。Removes an item from the collection at the specified index.

Extension Methods

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)

將轉換IEnumerableIQueryableConverts an IEnumerable to an IQueryable.

適用於