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

您無法多次將 加入 ListViewGroup 至集合。 當您使用已經在集合中的群組呼叫 Insert 方法時,插入只會失敗。 在插入之前使用 Contains 方法,判斷特定群組是否已經在集合中。 若要重新置放集合中的群組,您必須先將其移除,然後將它插入所需的索引處。

適用於

另請參閱