DesignSurface Class

Presents a user interface for designing components.

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

public class DesignSurface : IDisposable, IServiceProvider
public class DesignSurface implements IDisposable, IServiceProvider
public class DesignSurface implements IDisposable, IServiceProvider
Not applicable.

The DesignSurface class implements what the user perceives as a designer. DesignSurface is the user interface the user manipulates to change design-time features. DesignSurface provides a completely self-contained design surface.

The DesignSurface class may be used as a stand-alone designer, or it may be coupled with the DesignSurfaceManager class to provide a common implementation for an application that hosts multiple DesignSurface objects.

The DesignSurface class can be used by itself, or the user can derive a new class from it and augment the behavior.

The DesignSurface class provides several design-time services automatically. The DesignSurface class adds all of its services in its constructor. Most of these services can be overridden by replacing them in the protected ServiceContainer property. To replace a service, override the constructor, call base, and make any changes through the protected ServiceContainer property. All services that are added to the service container and that implement IDisposable are disposed when the design surface is disposed. The default set of replaceable services that the DesignSurface class provides is shown in the following table.




Enables objects that are not part of the container’s components collection to provide their own extender providers.


Used by TypeDescriptor to get a list of extender providers. With this service, extender providers can live outside of the container.


Provides designer metadata hooks. This is the primary interface for metadata filtering.


Provides a way to select components in the designer.


Provides a way to get a name for objects, even when those objects are not sited.


Offers the design surface itself as a service.


Provides a base class for getting and setting option values for a designer.

The following table shows the non-replaceable services provided by default.




Raises events as changes are made to components.


Controls access to types, services, and transactions. Master interface for designers.


Owns the set of components that are being designed. Each designer has an IContainer that owns the components.


Derives from IServiceProvider and provides a way to add and remove services from the designer.

In addition to these services, the DesignSurface class also provides a single service that is available through a component’s site. This service is unique for each component. The following table shows the services that cannot be replaced.




A generic dictionary of key/value pairs that can be used to store arbitrary data about a component.


A container that enables a component to add additional child components to the designer. These components will be part of the design surface, but will not participate in serialization. This is useful when you want to design a control that is capable of exposing a region of itself in a designer, but you do not want the region to participate in serialization.

In addition to ISite, the site also implements the following interfaces.

Caution noteCaution:

Check for the existence of these interfaces, rather than use indiscriminate casting, because other site implementations may not implement them.




Provides a way to get to the container of site-specific services. For example, IDictionaryService is a site-specific service. With this service, you can add additional site-specific services.


Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0