ListViewGroupCollection.IndexOf(ListViewGroup) 方法

定義

傳回集合中指定 ListViewGroup 的索引。

public:
 int IndexOf(System::Windows::Forms::ListViewGroup ^ value);
public int IndexOf (System.Windows.Forms.ListViewGroup value);
member this.IndexOf : System.Windows.Forms.ListViewGroup -> int
Public Function IndexOf (value As ListViewGroup) As Integer

參數

value
ListViewGroup

要在集合中尋找的 ListViewGroup

傳回

Int32

群組在集合內的以零起始索引;如果群組不在集合中,則為 -1。

備註

使用這個方法來判斷集合中群組的索引。 例如,當您使用 IEnumerator 方法所 GetEnumerator 傳回的 逐一查看集合時,這非常有用。

適用於

另請參閱