コレクション内の指定したインデックスにある項目を取得または設定します。
[C#] C# では、このプロパティは ListView.ListViewItemCollection クラスのインデクサになります。
Public Overridable Default Property Item( _
ByVal displayIndex As Integer _) As ListViewItem
[C#]
public virtual ListViewItem this[intdisplayIndex] {get; set;}
[C++]
public: __property virtual ListViewItem* get_Item(intdisplayIndex);public: __property virtual void set_Item(intdisplayIndex, ListViewItem*);
[JScript]
returnValue = ListViewItemCollectionObject.Item(displayIndex);ListViewItemCollectionObject.Item(displayIndex) = returnValue;またはreturnValue = ListViewItemCollectionObject(displayIndex);ListViewItemCollectionObject(displayIndex) = returnValue;
[JScript] JScript では、この型で定義されている既定のインデックス プロパティを使用することができます。しかし、独自のインデックス プロパティを明示的に定義することはできません。ただし、このクラスの expando 属性を指定すると、既定のインデックス プロパティが提供されます。提供されるインデックス プロパティの型は Object 型であり、インデックス型は String になります。
引数 [JScript]
- displayIndex
コレクション内で取得または設定する項目のインデックス。
パラメータ [Visual Basic, C#, C++]
- displayIndex
コレクション内で取得または設定する項目のインデックス。
プロパティ値
コレクション内の指定したインデックスにある項目を表す ListViewItem 。
例外
例外の種類 | 条件 |
---|---|
ArgumentOutOfRangeException | index パラメータの値が 0 未満か、 ListView.ListViewItemCollection の Count プロパティの値以上です。 |
解説
このメソッドを使用して、コレクション内の特定の位置に格納された ListViewItem を取得できます。特定の項目についてコレクション内のインデックスを確認するには、 IndexOf メソッドを使用します。
必要条件
プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ
参照
ListView.ListViewItemCollection クラス | ListView.ListViewItemCollection メンバ | System.Windows.Forms 名前空間 | IndexOf