Designer Attributes

Attributesplay a large role in every facet of .NET, from XML serialization to control development. The PropertyGrid relies heavily on custom attributes for object properties that it uses to determine the default value, determine whether the property is browsable, and make many other choices. Attributes are used to control the PropertyGrid and the code serializer, and for defining the UITypeEditor for a property, the designer for a component, and the category for a designer, among other things. The common case for attributes deals with interaction with the PropertyGrid and specifying the category, description, browsable, and type converter attributes. Figure 5.3 shows how attributes are used to control the PropertyGrid.

Figure ...

Get .NET Windows® Forms Custom Controls now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.