Indicates whether a control designer requires a preview instance of the control at design time. This class cannot be inherited.
Assembly: System.Design (in System.Design.dll)
Determines whether the specified object represents the same preview attribute setting as the current instance of the Attribute.Equals(Object).)class.(Overrides
Returns the hash code for this instance of the Attribute.GetHashCode().)class.(Overrides
Indicates whether the current instance of the Attribute.IsDefaultAttribute().)class is set to the default preview attribute value.(Overrides
When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.(Inherited from Attribute.)
Returns a string that represents the current object.(Inherited from Object.)
Gets an instance of theclass that is set to the default preview value. This field is read-only.
|_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)|
Maps a set of names to a corresponding set of dispatch identifiers.(Inherited from Attribute.)
|_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)|
Retrieves the type information for an object, which can be used to get the type information for an interface.(Inherited from Attribute.)
Retrieves the number of type information interfaces that an object provides (either 0 or 1).(Inherited from Attribute.)
|_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)|
Provides access to properties and methods exposed by an object.(Inherited from Attribute.)
Apply theattribute to a control designer class to indicate the type of preview control that is supported by the control designer. Use this attribute to change a preview control for design-time rendering without affecting the actual persisted instance of the associated control.
Typically, you specify the ControlDesigner class. The value of the SupportsPreviewControl property for the attribute determines the behavior for the UsePreviewControl and ViewControl members in the base ControlDesigner class.when declaring a custom designer class that is derived from the
Set the SupportsPreviewControl property to true to indicate that the designer uses a temporary copy of the associated control to generate the design-time HTML. Changes to the temporary control are not persisted.
Set the SupportsPreviewControl property to false to indicate that the designer returns the control instance, specifically the Component property, from the ViewControl method. Changes to the control object are persisted.
For example, the CalendarDesigner class is marked with the set to true. The designer uses the preview control with the automatic style formatting task, which allows the user to preview various autoformat stylesthat can be applied to the calendar. As the user selects different autoformat styles in the user interface, the selected style scheme is applied to the preview control. Applying a new style to the preview control does not change the scheme that is applied to the instance of the Calendar control in the designer.
Designer classes derived from the ControlDesigner class can override the UsePreviewControl and ViewControl members, and ignore the attribute. To determine the expected behavior for ViewControl and UsePreviewControl, see the reference documentation for the derived control designer class.
For general information about using attributes, see and Extending Metadata Using Attributes. For more information about design-time attributes, see Attributes and Design-Time Support.a4daf212-2410-423d-a800-7a08864e9bff
Legacy Code Example
The following code example demonstrates how to mark a control designer with the Label class and associates the ASP.NET server control with a custom control designer implementation. The control designer class declaration is marked with the SupportsPreviewControl attribute set to true. The control designer overrides the GetDesignTimeHtml method and encloses the design-time HTML for the control in italic tags.attribute. The code example derives an ASP.NET server control from the Code snippet is not found. Confirm that the code snippet name 'System.Web.UI.Design.SupportsPreviewControlAttribute' is correct.
Available since 2.0
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.