ListView.SelectedListViewItemCollection.Item[] 屬性

定義

從集合中取得項目。

多載

Item[String]

從集合中取得具有指定索引鍵的項目。

Item[Int32]

取得集合中位於指定索引處的項目。

Item[String]

從集合中取得具有指定索引鍵的項目。

public:
 virtual property System::Windows::Forms::ListViewItem ^ default[System::String ^] { System::Windows::Forms::ListViewItem ^ get(System::String ^ key); };
public virtual System.Windows.Forms.ListViewItem this[string key] { get; }
member this.Item(string) : System.Windows.Forms.ListViewItem
Default Public Overridable ReadOnly Property Item(key As String) As ListViewItem

參數

key
String

要從集合中擷取的項目名稱。

屬性值

ListViewItem

具有指定金鑰的 ListViewItem

備註

屬性 Name 會對應至 中的 索引 ListView.SelectedListViewItemCollectionListViewItem

索引鍵比較不區分大小寫。 key如果 參數為 null 或空字串,則 Item[]null 回 。

適用於

Item[Int32]

取得集合中位於指定索引處的項目。

public:
 property System::Windows::Forms::ListViewItem ^ default[int] { System::Windows::Forms::ListViewItem ^ get(int index); };
public System.Windows.Forms.ListViewItem this[int index] { get; }
member this.Item(int) : System.Windows.Forms.ListViewItem
Default Public ReadOnly Property Item(index As Integer) As ListViewItem

參數

index
Int32

要從集合中擷取的項目索引。

屬性值

ListViewItem

ListViewItem,表示集合中、位於指定索引處的項目。

例外狀況

index 參數小於零,或者大於等於 CountListView.SelectedListViewItemCollection 屬性值。

備註

此索引子可讓您從 ListView.SelectedListViewItemCollection 取得特定專案。 儲存在集合中的專案是 中的 ListView.ListViewItemCollection ListView 專案,代表 中 ListView 選取的專案。

適用於