語言

ListViewItem.ListViewSubItemCollection.IndexOf 方法

定義

回傳指定子項目集合中的索引。

public:
 int IndexOf(System::Windows::Forms::ListViewItem::ListViewSubItem ^ subItem);
public int IndexOf(System.Windows.Forms.ListViewItem.ListViewSubItem subItem);
public int IndexOf(System.Windows.Forms.ListViewItem.ListViewSubItem? subItem);
member this.IndexOf : System.Windows.Forms.ListViewItem.ListViewSubItem -> int
Public Function IndexOf (subItem As ListViewItem.ListViewSubItem) As Integer

參數

subItem
ListViewItem.ListViewSubItem

A ListViewItem.ListViewSubItem 代表要在集合中定位的子項目。

傳回

子項目在集合中位置的零基索引。 若子項目不在集合中,則返回值為負一(-1)。

備註

此 IndexOf 方法能讓你判斷子項目在集合中的位置。 若要判斷子項目是否包含在集合中,請先使用該 Contains 方法。

適用於

另請參閱