Represents the collection of selected items in the ListBox.
For a list of all members of this type, see ListBox.SelectedObjectCollection Members.
[Visual Basic] Public Class ListBox.SelectedObjectCollection Implements IList, ICollection, IEnumerable [C#] public class ListBox.SelectedObjectCollection : IList, ICollection, IEnumerable [C++] public __gc class ListBox.SelectedObjectCollection : public IList, ICollection, IEnumerable [JScript] public class ListBox.SelectedObjectCollection implements IList, ICollection, IEnumerable
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
The ListBox.SelectedObjectCollection class stores the selected items in the ListBox. The items stored in the ListBox.SelectedObjectCollection are items contained within the ListBox.ObjectCollection class. The ListBox.ObjectCollection class stores all items displayed in the ListBox.
The following table is an example of how the ListBox.ObjectCollection stores the items of the ListBox as well as their selection states within an example ListBox.
|Index||Item||Selection State Within the ListBox|
Based on the ListBox.ObjectCollection demonstrated in the previous table, the following table demonstrates how the ListBox.SelectedObjectCollection would appear.
|Index||Selected Item from ObjectCollection|
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 ListBox.ObjectCollection class is a member of the ListBox.SelectedObjectCollection. Once you know that the item is located within the collection, you can use the IndexOf method to determine where a specific item within the ListBox.ObjectCollection for the ListBox is stored within the ListBox.SelectedObjectCollection.
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)