Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

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)

public class CheckedListViewItemCollection : IList, ICollection, IEnumerable
public class CheckedListViewItemCollection implements IList, ICollection, 
	IEnumerable
public class CheckedListViewItemCollection implements 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 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0, 1.1, 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.