How do I “hide” controls that my control uses from the toolbox?

前端 未结 2 351
北恋
北恋 2020-12-10 11:14

I have developed a control in C#. Among other things this control can popup other controls at runtime. When you include the assembly in Visual Studio, the control that I c

相关标签:
2条回答
  • 2020-12-10 11:55

    Add the [ToolboxItem(false)] attribute to the classes that you don't want to show up in the toolbox.

    0 讨论(0)
  • 2020-12-10 12:20

    If you declare a UserControl as "internal" instead of "public", it will not show up in the toolbox when you reference the Assembly in another project.

    Update: or maybe that doesn't work at all. I can't get my simple test controls to work right when I try to host one in another. Let me know if "internal" works.

    0 讨论(0)
提交回复
热议问题