How to stop a Control from showing in the Toolbox

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.
 
G

Guest

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
~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
G

Guest

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
~~~~~~~~~~~~~~~~~~~~~~~~~~~
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top