Item Property (String)
Collapse the table of content
Expand the table of content

ComponentCollection.Item Property (String)

Gets any component in the collection matching the specified name.

Namespace:  System.ComponentModel
Assembly:  System (in System.dll)

public virtual IComponent this[
	string name
] { get; }


Type: System.String
The name of the IComponent to get.

Property Value

Type: System.ComponentModel.IComponent
A component with a name matching the name specified by the name parameter, or null if the named component cannot be found in the collection.

This method can be overridden by a derived class.

This property returns an IComponent in the collection if its Site property is not null and the Name property of its Site property matches the specified string.


This string indexer works only when the component is sited, which typically occurs only at design time. To site a Component at run time, set the Site property of the Component. The Name property of the ISite set to the Site property must also be set for this property to return the component.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

© 2015 Microsoft