views:

19

answers:

1

I am writing a windows forms UserControl and want to show a tree of properties for it in the designer. I have seen some controls that do this. For one control example, the "Appearance" property is a node that opens up to a set of properties, and also contains an "Options" node that opens to show even more properties. So far all I can get is a flat set of properties, and the properties that are objects containing more properties don't work (don't have the + button.) How do you set this up?

A: 

You should specify TypeConverter attribute as follows:

[TypeConverter(typeof(ExpandableObjectConverter))]
public class MyOptions {
}

public class MyUserControl {
    MyOptions options;

    public MyOptions Options { get { return options; } }
}
DevExpress Team