Grouping my custom management properties separately in the designer grid

I work with User Controls. I created my own management properties. Now I want to group my own properties separately in the constructor grid.

How to do it?

Hi

+7
source share
1 answer

Look, here is your answer . In other words, use the Category attribute for the property.

In addition, here is a link to a useful article ( Custom Development Time Management Features in Visual Studio .NET ). The article is quite old (2003.), but I could not find anything official that would be later. Also, I don't know if you need any other feature, but I think this should be a good place to start.

I tried this and it works for me:

 public partial class UserControl1 : UserControl { public UserControl1() { InitializeComponent(); } [Category("MyOwn")] public String MyProperty { get; set; } } 

Example1

Note, however, that you cannot see your properties when the designer of your user control is open. Custom properties will only be visible in the designer property grid when your custom control is part of another form / control and selected. When designing your controls, you do not have designer access to such properties. Look at my photo above. The form contains a user control, and then the user control is selected. Then the property is displayed in the property grid.

Also, make sure that the Categorization is selected in the PropertyGrid: Categorized view

+11
source

All Articles