System.Windows.Forms.Design.ControlDesigner.EnableDesignMode Method

Enables design time functionality for a child control.

Syntax

protected bool EnableDesignMode (System.Windows.Forms.Control child, string name)

Parameters

child
The child control for which design mode will be enabled.
name
The name of child as exposed to the end user.

Returns

true if the child control could be enabled for design time; false if the hosting infrastructure does not support it.

Remarks

The child control specified by child is a child of this control designer's control. The child does not directly participate in persistence, but it will if it is exposed as a property of the main control. Consider a control like the System.Windows.Forms.SplitContainer: it has two panels, Panel1 and Panel2. These panels are exposed through read only System.Windows.Forms.SplitContainer.Panel1 and System.Windows.Forms.SplitContainer.Panel2 properties on the System.Windows.Forms.SplitContainer control. The System.Windows.Forms.SplitContainer control's designer calls ControlDesigner.EnableDesignMode(System.Windows.Forms.Control, string) for each panel, which allows other components to be dropped on them. But, in order for the contents of System.Windows.Forms.SplitContainer.Panel1 and System.Windows.Forms.SplitContainer.Panel2 to be saved, the System.Windows.Forms.SplitContainer control itself must expose the panels as public properties.

Control names must be unique within a control designer, but they are not required to be unique with respect to the children of other control designers.

To support this feature, the hosting infrastructure must expose the System.ComponentModel.INestedContainer class as a service through the site.

Requirements

Namespace: System.Windows.Forms.Design
Assembly: System.Design (in System.Design.dll)
Assembly Versions: 2.0.0.0