ListBox.ObjectCollection Constructors

Definition

Initializes a new instance of ListBox.ObjectCollection.

Overloads

ListBox.ObjectCollection(ListBox)

Initializes a new instance of ListBox.ObjectCollection.

ListBox.ObjectCollection(ListBox, Object[])

Initializes a new instance of ListBox.ObjectCollection containing an array of objects.

ListBox.ObjectCollection(ListBox, ListBox+ObjectCollection)

Initializes a new instance of ListBox.ObjectCollection based on another ListBox.ObjectCollection.

ListBox.ObjectCollection(ListBox)

Initializes a new instance of ListBox.ObjectCollection.

public:
 ObjectCollection(System::Windows::Forms::ListBox ^ owner);
public ObjectCollection (System.Windows.Forms.ListBox owner);
new System.Windows.Forms.ListBox.ObjectCollection : System.Windows.Forms.ListBox -> System.Windows.Forms.ListBox.ObjectCollection
Public Sub New (owner As ListBox)

Parameters

owner
ListBox

The ListBox that owns the collection.

Exceptions

.NET 5 and later: owner is null.

Remarks

You cannot create an instance of this class without associating it with a ListBox control.

Applies to

ListBox.ObjectCollection(ListBox, Object[])

Initializes a new instance of ListBox.ObjectCollection containing an array of objects.

public:
 ObjectCollection(System::Windows::Forms::ListBox ^ owner, cli::array <System::Object ^> ^ value);
public ObjectCollection (System.Windows.Forms.ListBox owner, object[] value);
new System.Windows.Forms.ListBox.ObjectCollection : System.Windows.Forms.ListBox * obj[] -> System.Windows.Forms.ListBox.ObjectCollection
Public Sub New (owner As ListBox, value As Object())

Parameters

owner
ListBox

The ListBox that owns the collection.

value
Object[]

An array of objects to add to the collection.

Exceptions

.NET 5 and later: Either owner or value is null.

Remarks

You cannot create an instance of this class without associating it with a ListBox control.

Applies to

ListBox.ObjectCollection(ListBox, ListBox+ObjectCollection)

Initializes a new instance of ListBox.ObjectCollection based on another ListBox.ObjectCollection.

public:
 ObjectCollection(System::Windows::Forms::ListBox ^ owner, System::Windows::Forms::ListBox::ObjectCollection ^ value);
public ObjectCollection (System.Windows.Forms.ListBox owner, System.Windows.Forms.ListBox.ObjectCollection value);
new System.Windows.Forms.ListBox.ObjectCollection : System.Windows.Forms.ListBox * System.Windows.Forms.ListBox.ObjectCollection -> System.Windows.Forms.ListBox.ObjectCollection
Public Sub New (owner As ListBox, value As ListBox.ObjectCollection)

Parameters

owner
ListBox

The ListBox that owns the collection.

value
ListBox.ObjectCollection

A ListBox.ObjectCollection from which the contents are copied to this collection.

Exceptions

.NET 5 and later: Either owner or value is null.

Remarks

You cannot create an instance of this class without associating it with a ListBox control. This version of the constructor enables you to use the items specified in an existing instance of the ListBox.ObjectCollection class to add items to the collection when it is created. You can use this constructor to use the items specified in another ListBox control with this collection.

Applies to