I have not been able to find documentation on this mostly due to the fact that I don't know what exactly to search for. But I have seen how it's done in some ways before so I was able to get some properties to show up in the Properties Pane in Visual Studio, however I now need to add a Property with sub-properties in the Properties Pane. I am now back at square one - not knowing what to search for and not being able to implement it because I cannot find relevant information.
In the Properties pane for most Controls, you'll see this:
Appearance
- BackColor
- ForeColor
- Font
- Font Family
- Font Size, etc etc.
I can already do this:
Appearance
- BackColor
- ForeColor
- Hooray!Color
But, now I need to have something like the default Font property (add a property but then have sub-properties that are expandable/collapsible, like this:
Currently, the only way I know to get a custom property in the Properties Pane in VS is to do something like this:
public Boolean isBaeltazorAwesome { get; set; }
And that will show a single property in the properties pane. But I need something like in the picture below, where you can expand the Font property and get some more editable sub-properties.
How can this be done?
I know looking for references/off-site resources is "off-topic", but if you do know of any I would appreciate it if you could share. I just have no idea how to search for certain things when I don't know what terminology to use. Is that weird or what?
You could try to define the
TypeConverter
attribute for your custom property's type declaration:See example: Implementing TypeConverter for Windows Forms