ListView.ListViewItemCollection.IList.Insert(Int32, Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
插入物件至集合中的指定索引處。
virtual void System.Collections.IList.Insert(int index, System::Object ^ item) = System::Collections::IList::Insert;
void IList.Insert (int index, object item);
void IList.Insert (int index, object? item);
abstract member System.Collections.IList.Insert : int * obj -> unit
override this.System.Collections.IList.Insert : int * obj -> unit
Sub Insert (index As Integer, item As Object) Implements IList.Insert
參數
- index
- Int32
插入項目所在的索引位置 (以零為起始)。
- item
- Object
物件,表示要插入的項目。
實作
例外狀況
索引參數小於 0,或大於 Count 的 ListView.ListViewItemCollection 屬性值。
備註
參數 item
可以是任何類型。 如果 item
為 ListViewItem ,則會將它新增至 ListView.ListViewItemCollection 。 如果 item
是另一種類型,則會建立新的 ListViewItem ,其中包含 的 方法中的 ToStringitem
字串。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應