ListView.SelectedIndexCollection.IndexOf(Int32) 메서드

정의

ListView.SelectedIndexCollection 컨트롤의 ListView.ListViewItemCollection에 있는 지정된 인덱스의 ListView 내 인덱스를 반환합니다.

public:
 int IndexOf(int selectedIndex);
public int IndexOf (int selectedIndex);
member this.IndexOf : int -> int
Public Function IndexOf (selectedIndex As Integer) As Integer

매개 변수

selectedIndex
Int32

컬렉션에서 찾을 ListView.ListViewItemCollection의 인덱스(0부터 시작)입니다.

반환

Int32

ListView.ListViewItemCollection의 지정된 인덱스가 ListView.SelectedIndexCollection에 있으면 컬렉션의 해당 인덱스(0부터 시작)이거나, 인덱스가 컬렉션에 없으면 -1입니다.

설명

항목이 선택한 인덱스 컬렉션에 있다는 것을 알고 있으면(메서드 사용 Contains ) 메서드를 IndexOf 사용하여 인덱 ListView.SelectedIndexCollection스의 위치를 확인할 수 있습니다.

적용 대상

추가 정보