ListView.SelectedIndexCollection.Remove(Int32) 方法

定義

Items 移除位於 ListView.SelectedIndexCollection 集合中所指定索引處的項目。

public:
 void Remove(int itemIndex);
public void Remove (int itemIndex);
member this.Remove : int -> unit
Public Sub Remove (itemIndex As Integer)

參數

itemIndex
Int32

要從 Items 移除 ListView.SelectedIndexCollection 集合中的項目之索引。

例外狀況

指定的索引小於 0,或是大於或等於主控 ListView 中的項目數。

-或- 主控 ListView 處於虛擬模式中,而指定的索引小於 0,或是大於或等於 VirtualListSize 的值。

備註

ListView如果 處於虛擬模式,且尚未建立擁有者的 ListView 控制碼 (您可以使用 屬性) 來檢查此 Control.IsHandleCreated 專案,則呼叫 Remove 方法不會影響 ListView.SelectedIndexCollection

適用於