DesignSurface.CreateNestedContainer Method

Definition

Creates a container suitable for nesting controls or components.

Overloads

CreateNestedContainer(IComponent)

Creates a container suitable for nesting controls or components.

CreateNestedContainer(IComponent, String)

Creates a container suitable for nesting controls or components.

CreateNestedContainer(IComponent)

Creates a container suitable for nesting controls or components.

public:
 System::ComponentModel::INestedContainer ^ CreateNestedContainer(System::ComponentModel::IComponent ^ owningComponent);
public System.ComponentModel.INestedContainer CreateNestedContainer (System.ComponentModel.IComponent owningComponent);
member this.CreateNestedContainer : System.ComponentModel.IComponent -> System.ComponentModel.INestedContainer
Public Function CreateNestedContainer (owningComponent As IComponent) As INestedContainer

Parameters

owningComponent
IComponent

The component that manages the nested container.

Returns

The nested container.

Exceptions

owningComponent is null.

The IDesignerHost attached to the DesignSurface has been disposed.

Remarks

Adding a component to a nested container creates its designer and makes it eligible for all services available from the design surface. Components added to nested containers do not participate in serialization.

CreateNestedContainer(IComponent, String)

Creates a container suitable for nesting controls or components.

public:
 System::ComponentModel::INestedContainer ^ CreateNestedContainer(System::ComponentModel::IComponent ^ owningComponent, System::String ^ containerName);
public System.ComponentModel.INestedContainer CreateNestedContainer (System.ComponentModel.IComponent owningComponent, string containerName);
member this.CreateNestedContainer : System.ComponentModel.IComponent * string -> System.ComponentModel.INestedContainer
Public Function CreateNestedContainer (owningComponent As IComponent, containerName As String) As INestedContainer

Parameters

owningComponent
IComponent

The component that manages the nested container.

containerName
String

An additional name for the nested container.

Returns

The nested container.

Exceptions

owningComponent is null.

The IDesignerHost attached to the DesignSurface has been disposed.

Remarks

Adding a component to a nested container creates its designer and makes it eligible for all services available from the design surface. Components added to nested containers do not participate in serialization.

You can provide an additional name for the CreateNestedContainer method by passing a value into containerName.

Applies to