Adds the specified IComponent to the IContainer at the end of the list, and assigns a name to the component.
[Visual Basic] Overloads Sub Add( _ ByVal component As IComponent, _ ByVal name As String _ ) [C#] void Add( IComponent component, string name ); [C++] void Add( IComponent* component, String* name ) = 0; [JScript] function Add( component : IComponent, name : String );
None.
Exception Type | Condition |
---|---|
InvalidOperationException | name is already used by another component in the same container. |
The components within a container may or may not be named. If a component is given a name, the name must be unique among all the components within the container.
IContainer Interface | IContainer Members | System.ComponentModel Namespace | IContainer.Add Overload List