다음을 통해 공유


ListViewItem.ImageIndex 속성

항목에 표시되는 이미지의 인덱스를 가져오거나 설정합니다.

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

구문

‘선언
<LocalizableAttribute(True)> _
Public Property ImageIndex As Integer
‘사용 방법
Dim instance As ListViewItem
Dim value As Integer

value = instance.ImageIndex

instance.ImageIndex = value
[LocalizableAttribute(true)] 
public int ImageIndex { get; set; }
[LocalizableAttribute(true)] 
public:
property int ImageIndex {
    int get ();
    void set (int value);
}
/** @property */
public int get_ImageIndex ()

/** @property */
public void set_ImageIndex (int value)
public function get ImageIndex () : int

public function set ImageIndex (value : int)

속성 값

ImageList에서 항목에 표시되는 이미지의 인덱스(0부터 시작)입니다. 기본값은 -1입니다.

예외

예외 형식 조건

ArgumentException

지정된 값이 -1보다 작은 경우

설명

이 속성 값은 ImageList 속성 값에 따라 달라집니다. 항목에 연결된 ListView 컨트롤의 현재 View 속성 값에 따라 항목이 사용하는 ImageListLargeImageList 속성에 지정되었거나 ListView 컨트롤의 SmallImageList 속성에 지정된 목록일 수 있습니다. View 속성이 LargeIcon으로 설정되어 있으면 LargeImageList 속성에 지정된 ImageList가 사용됩니다. 그렇지 않으면 SmallImageList 속성에 지정된 ImageList가 사용됩니다. SmallImageList에 지정된 ImageList에 정의된 이미지는 LargeImageList 속성에 지정된 ImageList에 있는 이미지와 동일한 인덱스 위치를 사용해야 합니다. 인덱스 위치가 두 개의 ImageList 컨트롤에 대해 동일하면 ImageIndex 속성에 하나의 인덱스 값을 설정할 수 있으며 ListView 컨트롤의 View 속성 값에 관계 없이 해당 이미지가 표시됩니다. ImageKeyImageIndex 속성은 동시에 선택할 수 없으므로 한 속성이 설정되면 다른 속성은 무시됩니다. 또한 ImageKey 속성을 설정하면 ImageIndex 속성이 자동으로 -1로 설정되고, ImageIndex 속성을 설정하면 ImageKey가 자동으로 빈 문자열("")로 설정됩니다.

플랫폼

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에서 지원

참고 항목

참조

ListViewItem 클래스
ListViewItem 멤버
System.Windows.Forms 네임스페이스
ListView.View 속성
ListView.SmallImageList 속성
ListView.LargeImageList 속성