Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

Control.ControlCollection.Item Property

Indicates the Control at the specified indexed location in the collection.

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

[Visual Basic]
Public Overridable Default ReadOnly Property Item( _
   ByVal index As Integer _
) As Control
[C#]
public virtual Control this[
 int index
] {get;}
[C++]
public: __property virtual Control* get_Item(
 int index
);
[JScript]
returnValue = ControlCollectionObject.Item(index);
-or-
returnValue = ControlCollectionObject(index);

[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 index of the control to retrieve from the control collection.

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

index
The index of the control to retrieve from the control collection.

Property Value

The Control located at the specified index location within the control collection.

Exceptions

Exception Type Condition
ArgumentOutOfRangeException The index value is less than zero or is greater than or equal to the number of controls in the collection.

Remarks

To retrieve a Control from the Control.ControlCollection, reference the collection object with a specific index value. The index value of the Control.ControlCollection is a zero-based 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

See Also

Control.ControlCollection Class | Control.ControlCollection Members | System.Windows.Forms Namespace | Controls

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.