What's New in Design-Time Support in the .NET Framework 2.0

The .NET Framework 2.0 extends the .NET Framework 1.1 with new features, improvements to existing features, and enhancements to design-time development. This topic provides a summary of new designer features.

The Toolbox in Visual Studio now organizes components and controls into categories. It is also automatically populated with your project's components and controls.  

The DesignerAction feature enables components and controls to display context-sensitive information and commands. The DesignerAction feature can be thought of as a replacement for designer verbs, because a DesignerActionItem can be displayed in the smart-tag panel and also in the shortcut menu associated with a component or control. The DesignerActionList class represents the main point of interaction for developers wanting to add smart-tag support to their custom components and controls. For more information, see How to: Attach Smart Tags to a Windows Forms Component.

Improved layout support is now available for the run time and design environments.

Design Environment

Windows Forms controls support snaplines, which enable easy alignment of controls on your form. The SnapLine class gives you an implementation to extend your custom controls with snaplines.

For more information, see Walkthrough: Arranging Controls on Windows Forms Using Snaplines and Walkthrough: Arranging Controls on Windows Forms Using Snaplines and Walkthrough: Arranging Controls on Windows Forms Using Snaplines and Walkthrough: Arranging Controls on Windows Forms Using Snaplines and Walkthrough: Arranging Controls on Windows Forms Using Snaplines..

Run Time

TableLayoutPanel and FlowLayoutPanel are two new Windows Forms controls which enable scenarios that require proportional resizing and dynamic layout capabilities. For more information, see TableLayoutPanel Control (Windows Forms) and FlowLayoutPanel Control (Windows Forms).

You can implement your own custom layout behavior using the Control.LayoutEngine property and the LayoutEngine class. For more information, see How to: Implement a Custom Layout Engine.

Many of the interfaces specifying designer infrastructure now have default implementations which you can extend. The following table shows a list of the base classes along with their corresponding default implementations.

The following table shows the classes that implement designer infrastructure that are now available for you to use and extend.

Base Class

Description

CodeDomSerializerBase

Provides a base class for CodeDomSerializer classes.

ComponentSerializationService

Serializes a set of components or serializable objects into a serialization store.

ContainerFilterService

Provides a base class for the container filter service.

TypeDescriptionProvider

Provides supplemental metadata to TypeDescriptor.

The designer infrastructure offers an expanded set of designer services to help you build a rich design experience for your customers. For more information, see Design-Time Architecture.

In earlier versions of the .NET Framework, custom Windows Forms designers contained all the mouse-handling and keyboard-handling logic. The new Glyph, Behavior, and Adorner classes enable refactoring your appearance and behavior code into dedicated custom types. For more information, see How to: Extend the Appearance and Behavior of Controls in Design Mode.

The TypeDescriptionProvider class implements extensibility for the TypeDescriptor class. This enables a number of advanced scenarios, including instance substitution, metadata substitution, attribute redirection, and target substitution and shadowing.

For more information, see Type Descriptor Overview.

The UndoEngine class provides generic undo/redo support for property value changes on components. The DesignerTransaction class enables transactional processing on discrete work units that you can commit or roll back. You can make a series of changes to your components, then accept or cancel them all at once.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft