System.ComponentModel.DisplayNameAttribute Class

Specifies the display name for a property, event, or public void method which takes no arguments.

See Also: DisplayNameAttribute


[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Method | System.AttributeTargets.Property | System.AttributeTargets.Event | System.AttributeTargets.All)]
public class DisplayNameAttribute : Attribute


The default is the name of the property or event. The default implementation of DesignerActionList.GetSortedActionItems uses reflection to search the public properties and public void methods that take no arguments. DesignerActionList.GetSortedActionItems searches for the DisplayNameAttribute on each property and method and, if found, uses that string instead of the property or method name.


Namespace: System.ComponentModel
Assembly: System (in System.dll)
Assembly Versions:,
Since: .NET 2.0

The members of System.ComponentModel.DisplayNameAttribute are listed below.

See Also: Attribute

Public Constructors

Initializes a new instance of the DisplayNameAttribute class.

Initializes a new instance of the DisplayNameAttribute class using the display name.

Public Fields

static readonly

Specifies the default value for the DisplayNameAttribute. This field is read-only.

Public Properties


Gets the display name for a property, event, or public void method that takes no arguments stored in this attribute.

Protected Properties


Gets or sets the display name.

Public Methods

Equals(Object) : Boolean

Determines whether two DisplayNameAttribute instances are equal.

GetHashCode() : Int32

Returns the hash code for this instance.

IsDefaultAttribute() : Boolean

Determines if this attribute is the default.