DesignerAutoFormat.Name Property

Note: This property is new in the .NET Framework version 2.0.

Gets the name of a DesignerAutoFormat object.

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

public string Name { get; }
/** @property */
public String get_Name ()

public function get Name () : String

Property Value

The DesignerAutoFormat name.

A visual designer, such as Visual Studio 2005, uses the Name property from each DesignerAutoFormat object in the AutoFormats collection of a ControlDesigner to create a list of available automatic style formats.

The following code example demonstrates how to override the AutoFormats property of a ControlDesigner object to create and add three named formats to the collection.

// The collection of AutoFormat objects for the IndentLabel object
public override DesignerAutoFormatCollection AutoFormats
{
    get
    {
        if (_autoFormats == null)
        {
            // Create the collection
            _autoFormats = new DesignerAutoFormatCollection();

            // Create and add each AutoFormat object
            _autoFormats.Add(new IndentLabelAutoFormat("MyClassic"));
            _autoFormats.Add(new IndentLabelAutoFormat("MyBright"));
            _autoFormats.Add(new IndentLabelAutoFormat("Default"));
        }
        return _autoFormats;
    }
}

  • Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see .

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.

.NET Framework

Supported in: 2.0
Show: