DesignSurface Constructor (Type^)

 

Initializes a new instance of the DesignSurface class.

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

public:
DesignSurface(
	Type^ rootComponentType
)

Parameters

rootComponentType
Type: System::Type^

The type of root component to create.

Exception Condition
ArgumentNullException

rootComponent is null.

ObjectDisposedException

The IDesignerHost attached to the DesignSurface has been disposed.

When you use the DesignSurface constructor, it creates a simple designer loader that, in turn, creates a component of the given type and then ends the loading process. This is a straightforward way to create a designer, under the assumption that all saving of state will be done externally. Internally, this calls BeginLoad and passes the root component type.

System_CAPS_noteNote

The DesignSurface overload is not affected by DesignerOptions. The DesignerOptions must be in the service container before the design surface loads. If you need access to DesignerOptions, call the empty constructor, add the DesignerOptions to the ServiceContainer and call BeginLoad with rootComponentType.

.NET Framework
Available since 2.0
Return to top
Show: