Redigera

Dela via


ListBox.ObjectCollection.IList.Add(Object) Method

Definition

Adds an object to the ListBox class.

This API supports the product infrastructure and is not intended to be used directly from your code.

 virtual int System.Collections.IList.Add(System::Object ^ item) = System::Collections::IList::Add;
int IList.Add (object item);
int IList.Add (object? item);
abstract member System.Collections.IList.Add : obj -> int
override this.System.Collections.IList.Add : obj -> int
Function Add (item As Object) As Integer Implements IList.Add

Parameters

item
Object

The object to be added to the ListBox.

Returns

The position into which the new element was inserted, or -1 to indicate that the item was not inserted into the collection.

Implements

Exceptions

item is null.

The current ListBox has a data source.

There is insufficient space available to store the new item.

Remarks

This member is an explicit interface member implementation. It can be used only when the ListBox.ObjectCollection instance is cast to an IList interface.

Applies to