ComponentCollection.Item Property (String)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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
Available since 1.1
Return to top