Export (0) Print
Expand All

ComboBox.ObjectCollection Class

This class supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Represents the collection of items in a ComboBox.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public class ObjectCollection : IList, ICollection, IEnumerable
public class ObjectCollection implements IList, ICollection, 
	IEnumerable
public class ObjectCollection implements IList, ICollection, 
	IEnumerable
Not applicable.

The System.Windows.Forms.ComboBox.ObjectCollection class encapsulates the items in the ComboBox. The object collection of a combo box can be used to manage many types of objects, including strings, images, and custom business objects.

You can add items to the collection in several ways. The Add method adds one object to the collection. To add a number of objects to the collection, it is best to create an array of items and assign with the AddRange method. To insert an object at a specific location within the collection, you can use the Insert method. To remove items at a known index in the collection you can use either the Remove method or the RemoveAt method. The Clear method removes all the items from the collection.

In addition to methods and properties for adding and removing items, the System.Windows.Forms.ComboBox.ObjectCollection also provides methods to find items within the collection. The Contains method enables you to determine if an object is a member of the collection. Once you know that the item is located within the collection, you can use the IndexOf method to determine where the item is located within the collection.

System.Object
  System.Windows.Forms.ComboBox.ObjectCollection

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 Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft