ContainerControlDesigner Class
Provides designer functionality for controls that contain child controls or properties that can be modified at design time.
Assembly: System.Design (in System.Design.dll)
The ContainerControlDesigner class provides a base designer class for controls that can be modified on the design surface. This includes controls that contain child controls or editable inner properties. The ContainerControlDesigner provides a single framed region to represent the control, and automatically handles rendering the control at design time.
Apply the ParseChildrenAttribute attribute on the associated control to determine the design-time behavior of the ContainerControlDesigner. Apply the ParseChildrenAttribute settings on the associated control as follows:
false to indicate that the ContainerControlDesigner represents the contents of the editable design region as child controls.
true to indicate that the ContainerControlDesigner represents the contents of the editable design region as editable inner properties of the control.
Control developers can derive and extend a custom designer from one of several base designers depending on the kind of control that is being developed, as defined in the following list:
Controls that allow child controls to be added to it at design time can derive from the ContainerControlDesigner class. For example, the PanelContainerDesigner class is derived from the ContainerControlDesigner class and represents a Panel control on the design surface.
Controls that have one or more child controls, and might also have an editable designer region where controls can be added at design time, can derive from the CompositeControlDesigner class.
Controls that require custom design-time processing can derive from the base ControlDesigner class.
Note: |
|---|
The ContainerControlDesigner class replaces the obsolete ReadWriteControlDesigner class. |
Use the DesignerAttribute attribute to associate a custom designer class together with a custom control implementation. For detailed information about how to use control designers with custom controls, see Walkthrough: Creating a Basic Control Designer for a Web Server Control.
| Topic | Location |
|---|---|
| Walkthrough: Creating a Basic Control Designer for an ASP.NET Web Server Control | Authoring ASP.NET Controls |
| Walkthrough: Creating a Basic Control Designer for an ASP.NET Web Server Control | Authoring ASP.NET Controls |
The following code example demonstrates how to derive a designer class from the ContainerControlDesigner class. The example defines a simple control that is derived from the CompositeControl class, and then defines an associated designer, which is derived from the ContainerControlDesigner class. The derived designer class overrides the FrameCaption and FrameStyle properties to customize the frame that is around the editable region of the control on the design surface.
- System.Security.Permissions::SecurityPermission
for operating with unmanaged code. Associated enumeration: SecurityPermissionFlag::UnmanagedCode
System.ComponentModel.Design::ComponentDesigner
System.Web.UI.Design::HtmlControlDesigner
System.Web.UI.Design::ControlDesigner
System.Web.UI.Design::ContainerControlDesigner
System.Web.UI.Design.WebControls::MultiViewDesigner
System.Web.UI.Design.WebControls::PanelContainerDesigner
System.Web.UI.Design.WebControls::ViewDesigner
Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Note: