Export (0) Print
Expand All

Custom Designers

The .NET Framework provides the ability to provide custom behavior for a type of component while it is in design mode. Designers are classes that provide logic that can adjust the appearance or behavior of a type at design time. All designers implement the IDesigner interface. Designers are associated with a type or type member through a DesignerAttribute. A designer can perform tasks at design time after a component or control with which a designer is associated has been created.

Designers can be built to perform a variety of types of tasks in design mode. Designers can:

  • Alter and extend the behavior or appearance of components and controls in design mode.
  • Perform custom initialization for a component in design mode.
  • Access design-time services and configure and create components within a project.
  • Add menu items to the shortcut menu of a component.
  • Adjust the attributes, events, and properties exposed by a component with which the designer is associated.

Designers can serve an important role in assisting with the arrangement and configuration of components, or to enable proper behavior for a component in design mode that otherwise depends on services or interfaces available only at run time.

Some controls may require visual cues in design mode to make configuration easier. For example, a System.Windows.Forms.Panel object might not have a visible border at run time. Without a border, the panel is not visible on a form with the same background color. Therefore, the designer for the System.Windows.Forms.Panel object draws a dotted-line border around the panel.

The System.ComponentModel.Design namespace provides the basic interfaces that developers can use to build design-time support.

See Also

Enhancing Design-Time Support | Base Designer Classes | Enabling Property Filtering | Designer Verbs |Windows Forms Designer Sample | Web Forms Templated Data-Bound Control Designer Sample

Show:
© 2014 Microsoft