Export (0) Print
Expand All

ListView.CheckedListViewItemCollection Class

Represents the collection of checked items in a list view control.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[ListBindableAttribute(false)]
public class CheckedListViewItemCollection : IList, 
	ICollection, IEnumerable

A ListView.CheckedListViewItemCollection stores the checked items in a ListView control. Items can only be checked if the CheckBoxes property of the ListView control is set to true. The items stored in the ListView.CheckedListViewItemCollection are items contained in the ListView.ListViewItemCollection. The ListView.ListViewItemCollection class stores all items displayed in the ListView control.

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

Checked state in the ListView

0

Item1

Unchecked

1

Item2

Checked

2

Item3

Unchecked

3

Item4

Checked

4

Item5

Checked

Based on the ListView.ListViewItemCollection example in the previous table, the following table demonstrates how the ListView.CheckedListViewItemCollection would appear.

Index

Checked item in ListViewItemCollection

0

Item2

1

Item4

2

Item5

You can use the properties and methods of this class to perform a variety of tasks with the collection. The Contains method enables you to determine whether an item from the ListView.ListViewItemCollection class is a member of the ListView.CheckedListViewItemCollection. Once 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.

System.Object
  System.Windows.Forms.ListView.CheckedListViewItemCollection

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft