다음을 통해 공유


ListView.SelectedIndexCollection.Contains 메서드

지정된 인덱스가 컬렉션에 위치하는지 여부를 확인합니다.

네임스페이스: System.Windows.Forms
어셈블리: System.Windows.Forms(system.windows.forms.dll)

구문

‘선언
Public Function Contains ( _
    selectedIndex As Integer _
) As Boolean
‘사용 방법
Dim instance As SelectedIndexCollection
Dim selectedIndex As Integer
Dim returnValue As Boolean

returnValue = instance.Contains(selectedIndex)
public bool Contains (
    int selectedIndex
)
public:
bool Contains (
    int selectedIndex
)
public boolean Contains (
    int selectedIndex
)
public function Contains (
    selectedIndex : int
) : boolean

매개 변수

  • selectedIndex
    컬렉션에서 찾을 인덱스입니다.

반환 값

ListView에 대한 ListView.ListViewItemCollection의 지정된 인덱스가 컬렉션의 항목이면 true이고, 그렇지 않으면 false입니다.

설명

Contains 메서드를 사용하면 ListView.ListViewItemCollection의 인덱스 위치가 ListView.SelectedIndexCollection에 저장된 선택된 인덱스 중 하나인지 여부를 확인할 수 있습니다. 선택된 인덱스 컬렉션 내에 항목이 있음이 확인되면 IndexOf 메서드를 사용하여 ListView.SelectedIndexCollection에서 인덱스의 위치를 결정할 수 있습니다.

플랫폼

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework에서 모든 플래폼의 모든 버전을 지원하지는 않습니다. 지원되는 버전의 목록은 시스템 요구 사항을 참조하십시오.

버전 정보

.NET Framework

2.0, 1.1, 1.0에서 지원

.NET Compact Framework

2.0, 1.0에서 지원

참고 항목

참조

ListView.SelectedIndexCollection 클래스
ListView.SelectedIndexCollection 멤버
System.Windows.Forms 네임스페이스
IndexOf