System.ComponentModel.DefaultValueAttribute Class

Specifies the default value for a property.

See Also: DefaultValueAttribute Members

Syntax

[System.AttributeUsage(System.AttributeTargets.All)]
public class DefaultValueAttribute : Attribute

Remarks

You can create a System.ComponentModel.DefaultValueAttribute with any value. A member's default value is typically its initial value. A visual designer can use the default value to reset the member's value. Code generators can use the default values also to determine whether code should be generated for the member.

Note:

A System.ComponentModel.DefaultValueAttribute will not cause a member to be automatically initialized with the attribute's value. You must set the initial value in your code.

For more information, see Extending Metadata Using Attributes.

Requirements

Namespace: System.ComponentModel
Assembly: System (in System.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0, 2.0.0.0, 4.0.0.0