다음을 통해 공유


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

속성 값

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와 같은 비주얼 디자이너는 의 컬렉션에 있는 AutoFormatsDesignerAutoFormat 개체의 ControlDesigner 속성을 사용하여 Name 사용 가능한 자동 스타일 형식 목록을 만듭니다.

적용 대상

추가 정보