Sunday, June 26, 2005

Property Browser with Custom Controls

One cool feature of VS2005 is the integration of user controls into the Forms Designer. You can even categorize your properties by using browse attributes. By default new properties for a control are filed under "misc" to change this add:

[
CategoryAttribute("Appearance"),
DescriptionAttribute("This is a description of this property")
]
public object MyProperty{
get { ... }
set { ... }
}

For more info on customizing the property browser, go here and search for "Property Browser" within your web browser.

UPDATE (06/26/2005 @ 12:09PM): It appears that the .NET Compact Framework has a relatively restricted ComponentModel space to affect run-time and design-time behaviors. For example, code completion with System.ComponentModel in VS2005 b2 shows only three available methods: (1) DefaultValue (2) DesignerCategory and (3) EditorBrowsable

No comments: