ListBox.ObjectCollection Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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)
- Source:
- ListBox.ObjectCollection.cs
- Source:
- ListBox.ObjectCollection.cs
- Source:
- ListBox.ObjectCollection.cs
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
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[])
- Source:
- ListBox.ObjectCollection.cs
- Source:
- ListBox.ObjectCollection.cs
- Source:
- ListBox.ObjectCollection.cs
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
- 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)
- Source:
- ListBox.ObjectCollection.cs
- Source:
- ListBox.ObjectCollection.cs
- Source:
- ListBox.ObjectCollection.cs
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
- 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.