DesignerAutoFormat Class
Assembly: System.Design (in system.design.dll)
DesignerAutoFormat provides a base class that can be inherited from and extended to display a formatted custom Web server control at design time.
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:
-
Create the custom control.
-
Derive a designer class from the ControlDesigner class or another designer class that is appropriate for your control, such as the TextControlDesigner.
-
Derive a format class from the DesignerAutoFormat class, that formats your custom control by overriding the Apply method.
-
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.
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.