DesignerAutoFormat Class

Provides the abstract base class for creating formats that can be applied to a custom Web server control at design time.

Namespace: System.Web.UI.Design
Assembly: System.Design (in system.design.dll)

public ref class DesignerAutoFormat abstract
public abstract class DesignerAutoFormat
public abstract class DesignerAutoFormat
Not applicable.

DesignerAutoFormat provides a base class that can be inherited from and extended to display a formatted custom Web server control at design time in a visual designer tool such as Visual Studio 2005.

A control developer provides automatic formatting in order to help developers who use the control to select a preferred display. A custom DesignerAutoFormat object works with a custom control designer to provide automatic formatting at design time for a custom control. For example, the Calendar control provides a variety of formats that can be applied by a developer at design time.

To implement automatic formatting for a custom control:

  1. Create the custom control.

  2. Derive a designer class from the ControlDesigner class or another designer class that is appropriate for your control, such as the TextControlDesigner.

  3. Derive a format class from the DesignerAutoFormat class that formats your custom control by overriding the Apply method.

  4. In your designer class, populate the AutoFormats property, which is a DesignerAutoFormatCollection object, with one instance of your format class for each named format that your designer can apply.

The DesignerAutoFormat class provides the following members to support automatic formatting at design time:

  • The Apply method, which applies the named format to the specified control.

  • The GetPreviewControl method, which provides a copy of the control for previewing in an AutoFormat dialog box of a visual designer such as Visual Studio 2005.

  • The Name property, which provides the text to display in a list of formats in a visual designer.

Notes to Inheritors: When you inherit from the DesignerAutoFormat class, you must override the Apply method to preview a formatted control and to apply the selected format to your control.

The following code example demonstrates how to implement automatic formatting in a custom control designer. The derived control designer implements the AutoFormats property by adding three instances of a custom automatic format that are derived from the DesignerAutoFormat class.

No code example is currently available or this language may not be supported.

System.Object
  System.Web.UI.Design.DesignerAutoFormat

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show: