Custom Categories and Sub Categories for UserControl's Custom Properties
I have create a UserControl and some custom properties for it but I want to group them into a custom category with "sub categories". Something like that.
Code:
|+| Custom Category Name
|+| Custom Sub Category
|+| My Property
My Value1 Header: Value1
My Value2 Header: Value2
OR
|+| Custom Category Name
|+| Custom Sub Category
My Property: Value
I know how to make custom properties and add them into custom categories, but how can I make sub categories and add my custom properties in?
Re: Custom Categories and Sub Categories for UserControl's Custom Properties
You're asking about Expandable Properties. I have a few examples in the MSDN code samples linked to in my signature...
Edit: It's not a 2 minute process, but the examples are complete
Re: Custom Categories and Sub Categories for UserControl's Custom Properties
Are you talking about this code example?
Re: Custom Categories and Sub Categories for UserControl's Custom Properties
Re: Custom Categories and Sub Categories for UserControl's Custom Properties
Okay my friend, thank you very much for your time. I'll have to study this code example carefully, it contains small "treasures"!!! :)
Re: Custom Categories and Sub Categories for UserControl's Custom Properties
If you literally are using Size or Point they would automatically be expandable properties, but it takes a little more work to create custom expandable properties
Re: Custom Categories and Sub Categories for UserControl's Custom Properties
Quote:
Originally Posted by
.paul.
If you literally are using Size or Point they would automatically be expandable properties, but it takes a little more work to create custom expandable properties
Yes I know that, I have already noticed!!! I am talking about custom properties which I have create, like CustomBackColor, CustomFont and much more and I just want to group them so Properties Window not look so messy. For example, for CustomBackColor custom property, I would like to add a sub category under Appearece, by the name Extra Properties and add CustomBackColor custom property inside!!!
Code:
|+| Appearece
|+| Extra Properties
CustomBackColor: Value
Re: Custom Categories and Sub Categories for UserControl's Custom Properties
You can't add sub-categories, in the end that's just as cluttered as not having categories at all. You get one layer of categories, so use it wisely.
Generally, you don't add a new BackColor property with a different name to a control. Users are used to using BackColor, and expect to use that. If what that color does is more specific, give it a name that says what it does.
Re: Custom Categories and Sub Categories for UserControl's Custom Properties
Quote:
Originally Posted by
Sitten Spynne
You can't add sub-categories, in the end that's just as cluttered as not having categories at all. You get one layer of categories, so use it wisely.
Oh... So in that case I can't do what I want. Except if I create a Form with a PropertyGrid control inside, which will popup in Design Time, when user click on specific Property on Properties Window? Is than an option? Can I do something like that?
Quote:
Originally Posted by
Sitten Spynne
Generally, you don't add a new BackColor property with a different name to a control. Users are used to using BackColor, and expect to use that. If what that color does is more specific, give it a name that says what it does.
I agree!!! CustomBackColor and CustomFont was fake property names, just for example!!!
Re: Custom Categories and Sub Categories for UserControl's Custom Properties
Quote:
Originally Posted by
Simonetos The Greek
Oh... So in that case I can't do what I want. Except if I create a Form with a PropertyGrid control inside, which will popup in Design Time, when user click on specific Property on Properties Window? Is than an option? Can I do something like that?
Once you commit to creating a custom property editor, you can basically do whatever you want.
That process involves implementing some interfaces and applying some attributes I don't quite remember. (I did this for 6 years, but that was 5 years ago.) At a high level, a "UI Editor" for a control is a UserControl that gets a property value and has to publish changes to that value in a particular way. So whatever thing you can imagine is possible.
But I re-iterate: overcategorization is worse than no categorization. I haven't used the "category" view for years to edit properties, I like them alphabetized so I can get to the ones I want. If your control takes 4 extra clicks to edit some property, I'd much rather use someone else's that takes fewer clicks.
Re: Custom Categories and Sub Categories for UserControl's Custom Properties
Quote:
Originally Posted by
Sitten Spynne
Once you commit to creating a custom property editor, you can basically do whatever you want.
That process involves implementing some interfaces and applying some attributes I don't quite remember. (I did this for 6 years, but that was 5 years ago.) At a high level, a "UI Editor" for a control is a UserControl that gets a property value and has to publish changes to that value in a particular way. So whatever thing you can imagine is possible.
But I re-iterate: overcategorization is worse than no categorization. I haven't used the "category" view for years to edit properties, I like them alphabetized so I can get to the ones I want. If your control takes 4 extra clicks to edit some property, I'd much rather use someone else's that takes fewer clicks.
Thank you very much for your help and your advices!!! I'll keep them in mind...
Re: Custom Categories and Sub Categories for UserControl's Custom Properties
What S and S is recommending is what i showed you in that example...