See Also: DesignerRegion Members
The System.Web.UI.Design.DesignerRegion object represents a region of content within the design-time markup that is generated by a System.Web.UI.Design.ControlDesigner implementation. A control developer uses designer regions in a custom System.Web.UI.Design.ControlDesigner implementation to define separate areas within the design-time markup for the associated control and to provide editing and event handling for the area. A visual designer, such as vsprvslong, can use designer regions to display the separate areas of a control on the design surface and to raise user events for the region to the control designer. Designer regions can simplify a control designer implementation because many region-based features are provided by the base designer classes and the visual designer.
The System.Web.UI.Design.DesignerRegion class provides the base functionality for designer regions, such as the ability to click, select, and highlight a region in the design surface. Use a System.Web.UI.Design.DesignerRegion object in a control designer implementation to define a region that does not require editing. Use the derived System.Web.UI.Design.EditableDesignerRegion class in a control designer implementation to define a region with editable content at design time. Use the derived System.Web.UI.Design.TemplatedEditableDesignerRegion class in a control designer implementation to define an editable region that represents a template in a control.
To support regions within a class that is derived from the System.Web.UI.Design.ControlDesigner, override the ControlDesigner.GetDesignTimeHtml(DesignerRegionCollection) method and add one or more initialized System.Web.UI.Design.DesignerRegion objects to the System.Web.UI.Design.DesignerRegionCollection collection. Optionally, you can handle mouse clicks in the regions on the design surface by overriding the ControlDesigner.OnClick(DesignerRegionMouseEventArgs) method.
Use the properties of a System.Web.UI.Design.DesignerRegion object to determine how the region is displayed by the visual designer. Override the DesignerRegion.Selectable property to indicate that the region can be selected by the user on the design surface. Use the DesignerRegion.Highlight property to highlight the designer region in the visual designer; for example, you can highlight a region after a user has clicked to select it. Use the DesignerRegion.DisplayName and DesignerRegion.Description properties to store or retrieve additional details about the region. In particular, the DesignerRegion.Description property is used by the visual designer to display ToolTip information when the user moves the mouse pointer over the designer region. Use the DesignerObject.Designer property to access the methods and properties of the control designer object that contains the designer region.