How to set description for my Custom Control to sh

2020-03-25 18:48发布

问题:

I want to add a text that tells the designer what my control is into my custom control when it is in design time. Like VS default controls in here:

I have tried ///summary but it didn't work for me. How can it be done?

回答1:

You can decorate your class with Description attribute. Then when you add the control to toolbox using Choose Items ... or using a vsix package, the description will be shown as a tooltip for your control:

[Description("Some Description")]
public partial class UserControl1 : UserControl
{
}