DesignerAutoFormat.Name Eigenschap

Definitie

Hiermee haalt u de naam van een DesignerAutoFormat object op.

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

Waarde van eigenschap

De DesignerAutoFormat naam.

Voorbeelden

In het volgende codevoorbeeld ziet u hoe u de AutoFormats eigenschap van een ControlDesigner object overschrijft om drie benoemde indelingen aan de verzameling te maken en toe te voegen.

// 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

Opmerkingen

Een visuele ontwerper, zoals Visual Studio 2005, gebruikt de eigenschap Name van elk object DesignerAutoFormat in de verzameling AutoFormats van een ControlDesigner om een lijst met beschikbare automatische stijlindelingen te maken.

Van toepassing op

Zie ook