ListView.CheckedListViewItemCollection 類別

定義

表示清單檢視控制項中之核取項目的集合。

public: ref class ListView::CheckedListViewItemCollection : System::Collections::IList
public 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
[<System.ComponentModel.ListBindable(false)>]
type ListView.CheckedListViewItemCollection = class
    interface IList
    interface ICollection
    interface IEnumerable
Public Class ListView.CheckedListViewItemCollection
Implements IList
繼承
ListView.CheckedListViewItemCollection
屬性
實作

備註

會將 ListView.CheckedListViewItemCollection 核取的專案儲存在 控制項中 ListView 。 只有當 控制項的 ListView 屬性設定 true 為 時 CheckBoxes ,才能檢查項目。 中 ListView.CheckedListViewItemCollection 儲存的專案是 中包含的 ListView.ListViewItemCollection 專案。 類別 ListView.ListViewItemCollection 會儲存控制項中顯示的 ListView 所有專案。

下表顯示 範例, ListView.ListViewItemCollection 說明 如何將 的專案 ListView 及其選取狀態儲存在範例 ListView 控制項中。

索引 Item ListView 中的已核取狀態
0 Item1 未核取
1 Item2 已檢查
2 Item3 未核取
3 Item4 已檢查
4 Item5 已檢查

下表根據 ListView.ListViewItemCollection 上表的範例,下表示范 的顯示方式 ListView.CheckedListViewItemCollection

索引 ListViewItemCollection 中的核取專案
0 Item2
1 Item4
2 Item5

您可以使用這個類別的屬性和方法,搭配集合執行各種工作。 方法 Contains 可讓您判斷 類別中的 ListView.ListViewItemCollection 專案是否為 的成員 ListView.CheckedListViewItemCollection 。 一旦您知道專案位於集合中,您就可以使用 IndexOf 方法來判斷 專案在 中 ListView.CheckedListViewItemCollection 的位置。

建構函式

ListView.CheckedListViewItemCollection(ListView)

初始化 ListView.CheckedListViewItemCollection 類別的新執行個體。

屬性

Count

取得集合中的項目數目。

IsReadOnly

取得值,表示集合是否為唯讀。

Item[Int32]

取得集合中位於指定索引處的項目。

Item[String]

取得集合中具有指定索引鍵的項目。

方法

Contains(ListViewItem)

判斷指定的項目是否位於集合中。

ContainsKey(String)

判斷具有指定索引鍵的資料行是否包含在集合中。

CopyTo(Array, Int32)

將整個集合複製到現有陣列中的指定位置。

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetEnumerator()

傳回用於逐一查看選取項目集合的列舉值。

GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
IndexOf(ListViewItem)

傳回指定項目集合中的索引。

IndexOfKey(String)

判斷具有指定索引鍵之項目的索引。

MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

明確介面實作

ICollection.IsSynchronized

取得值,這個值表示對 ListView.CheckedListViewItemCollection 的存取是否同步 (安全執行緒)。

ICollection.SyncRoot

取得可用來對控制項集合進行同步 (Synchronize) 存取的物件。

IList.Add(Object)

將項目新增至集合。

IList.Clear()

移除集合的所有項目。

IList.Contains(Object)

驗證項目是否已核取。

IList.IndexOf(Object)

傳回指定項目集合中的索引。

IList.Insert(Int32, Object)

在指定的索引位置,插入項目至集合之中。

IList.IsFixedSize

取得值,這個值表示集合的大小是否是固定的。

IList.Item[Int32]

取得或設定集合中的物件。

IList.Remove(Object)

從集合移除第一個項目。

IList.RemoveAt(Int32)

從集合中的指定索引處移除項目。

擴充方法

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。

AsParallel(IEnumerable)

啟用查詢的平行化作業。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

適用於