How to stop a Control from showing in the Toolbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've developed a C# Windows Control Library project (using Visual Studio
2003). It contains a public component class and a public control class. When
I add a reference to the compiled project dll in a new project and add it in
the ToolBox, both the component class and the control class are displayed in
the toolbox.

The control class should never been displayed in the ToolBox.

How can I stop the control class being displayed in the ToolBox?

Thanks for your help.
 
Mark Collard said:
How can I stop the control class being displayed in the ToolBox?

Add the following attribute to the class definition:

[ToolboxItem( false )]

~~~~~~~~~~~~~~~~~~~~~~~~~~~
Timm Martin
Mini-Tools
..NET Components and Windows Software
http://www.mini-tools.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Thanks. That did the trick.

Regards
Mark

Mini-Tools Timm said:
Mark Collard said:
How can I stop the control class being displayed in the ToolBox?

Add the following attribute to the class definition:

[ToolboxItem( false )]

~~~~~~~~~~~~~~~~~~~~~~~~~~~
Timm Martin
Mini-Tools
.NET Components and Windows Software
http://www.mini-tools.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
Back
Top