如何设置要在工具箱中显示的自定义控件的说明? [英] How to set description for my Custom Control to show in ToolBox?

查看:128
本文介绍了如何设置要在工具箱中显示的自定义控件的说明?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在设计时添加一个文本,告诉设计者自定义控件中有什么控件.就像这里的VS默认控件一样:

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:

我尝试了///summary,但是对我来说不起作用.怎么办?

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

推荐答案

您可以使用

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
{
}

这篇关于如何设置要在工具箱中显示的自定义控件的说明?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆