語言

ListViewGroupCollection.Insert(Int32, ListViewGroup) 方法

定義

將指定的 ListViewGroup 資料插入到指定的索引中。

public:
 void Insert(int index, System::Windows::Forms::ListViewGroup ^ group);
public void Insert(int index, System.Windows.Forms.ListViewGroup group);
member this.Insert : int * System.Windows.Forms.ListViewGroup -> unit
Public Sub Insert (index As Integer, group As ListViewGroup)

參數

index
Int32

集合內插入該群組的索引。

group
ListViewGroup

將 ListViewGroup 插入收藏。

例外狀況

這個收藏被分配到的 是 ListView 虛擬模式。

備註

使用此方法將特定索引的存在 ListViewGroup 插入集合中。

你不能將 a ListViewGroup 加入收藏超過一次。 當你用集合中已經存在的群組呼叫該 Insert 方法時,插入會直接失敗。 在插入前使用該 Contains 方法判斷某一群組是否已在集合中。 若要重新定位集合中的群組,必須先移除它,然後插入到想要的索引位置。

適用於

另請參閱