Attributes in Windows Forms Controls
The .NET Framework provides a variety of attributes you can apply to the members of your custom controls and components. Some of these attributes affect the run-time behavior of a class, and others affect the design-time behavior.
Attributes for Control and Component Properties
The following table shows the attributes you can apply to properties or other members of your custom controls and components. For an example that uses many of these attributes, see How to: Apply Attributes in Windows Forms Controls.
Attribute |
Description |
---|---|
Specifies the value to pass to a property to cause the property to get its value from another source. This is known as ambience. |
|
Specifies whether a property or event should be displayed in a Properties window. |
|
Specifies the name of the category in which to group the property or event when displayed in a PropertyGrid control set to Categorized mode. |
|
Specifies the default value for a property. |
|
Specifies a description for a property or event. |
|
Specifies the display name for a property, event, or public void method that takes no arguments. |
|
Specifies the editor to use to change a property. |
|
Specifies that a property or method is viewable in an editor. |
|
Specifies the context keyword for a class or member. |
|
Specifies whether a property should be localized. |
|
Indicates that an object's text representation is obscured by characters such as asterisks. |
|
Specifies whether the property this attribute is bound to is read-only or read/write at design time. |
|
Indicates that the property grid should refresh when the associated property value changes. |
|
Specifies what type to use as a converter for the object this attribute is bound to. |
Attributes for Data Binding Properties
The following table shows the attributes you can apply to specify how your custom controls and components interact with data binding.
Attribute |
Description |
---|---|
Specifies whether a property is typically used for binding. |
|
Specifies the data source and data member properties for a component. |
|
Specifies the default binding property for a component. |
|
Specifies the data source and data member properties for a component. |
|
Enables attribute redirection. |
Attributes for Classes
The following table shows the attributes you can apply to specify the behavior of your custom controls and components at design time.
Attribute |
Description |
---|---|
Specifies the default event for a component. |
|
Specifies the default property for a component. |
|
Specifies the class used to implement design-time services for a component. |
|
Specifies that the designer for a class belongs to a certain category. |
|
Represents an attribute of a toolbox item. |
|
Specifies the filter string and filter type to use for a Toolbox item. |
See Also
Tasks
How to: Apply Attributes in Windows Forms Controls
Reference
Other Resources
Developing Custom Windows Forms Controls with the .NET Framework