Array.System.Collections.IList.Item Property

Note: This namespace, class, or member is supported only in version 1.1 of the .NET Framework.

Gets or sets the element at the specified index.

[C#] In C#, this property is the indexer for the Array class.

Private Default Property Item( _
   ByVal index As Integer _) As Object Implements IList.Item
[C#]
object IList.this[
   intindex] {get; set;}
[C++]
private: __property Object* System::Collections::IList::get_Item(intindex);private: __property void System::Collections::IList::set_Item(intindex,   Object*);
[JScript]
private function get IList.get_Item(index : int) : Object;private function set IList.set_Item(index : int, value : Object);-or-private function get IList.get_Item(index : int) : Object;private function set IList.set_Item(index : int, value : Object);

[JScript] In JScript, you can use the default indexed properties defined by a type, but you cannot explicitly define your own. However, specifying the expando attribute on a class automatically provides a default indexed property whose type is Object and whose index type is String.

Arguments [JScript]

  • index
    The zero-based index of the element to get or set.

Parameters [Visual Basic, C#, C++]

  • index
    The zero-based index of the element to get or set.

Property Value

The element at the specified index.

Implements

IList.Item

Exceptions

Exception Type Condition
ArgumentOutOfRangeException index is less than zero.

-or-

index is equal to or greater than ICollection.Count.

Remarks

This property provides the ability to access a specific element in the collection by using the following syntax: myCollection[index].

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Common Language Infrastructure (CLI) Standard

See Also

Array Class | Array Members | System Namespace | ICollection.Count