DesignerAutoFormat.Name 属性

定义

获取 DesignerAutoFormat 对象的名称。

public:
 property System::String ^ Name { System::String ^ get(); };
public string Name { get; }
member this.Name : string
Public ReadOnly Property Name As String

属性值

String

DesignerAutoFormat 名称。

示例

下面的代码示例演示如何重写 AutoFormats 对象的属性,以创建和向集合添加三种 ControlDesigner 命名格式。

// 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;
    }
}
' The collection of AutoFormat objects for the IndentLabel object
Public Overrides ReadOnly Property AutoFormats() As DesignerAutoFormatCollection
    Get
        If _autoFormats Is Nothing Then
            ' 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"))
        End If

        Return _autoFormats
    End Get
End Property

注解

可视化设计器(如 Visual Studio 2005)使用Name集合ControlDesignerAutoFormats每个DesignerAutoFormat对象的属性来创建可用自动样式格式的列表。

适用于

另请参阅