語言

ListBox.ObjectCollection.IList.Add(Object) 方法

定義

為類別新增一個物件 ListBox 。

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

 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

參數

item
Object

要加入到 的 ListBox物件。

傳回

新元素插入的位置,或 -1 表示該項目未入集合。

實作

例外狀況

item 是 null。

電流 ListBox 有資料來源。

新物品的存放空間不足。

備註

此成員為明確介面成員實作。 它只能在實 ListBox.ObjectCollection 例投射到 IList 介面時使用。

適用於