.NET Framework - Custom Control not appearing in Toolbox

Asked By JTC^..^
29-Dec-07 12:40 PM
When I create a custom control inside my Windows Application project
it does not appear in the toolbox. I'm using Visual Studio 2005 (Team
System for Developers), so this should appear automatically, right?

I've compiled the application and selected show all items, but the
controls do not appear.

If I create an external Windows Control library and import the
controls they appear. I also tried resetting the toolbox, then
creating a new control. As the behaviour of resetting the toolbox is
to remove custom controls, could this now be my problem? Either way,
is there a setting or something I'm missing so Visual Studio will show
the controls automatically?

Thanks
Visual Studio 2005
(1)
Application
(1)
Control
(1)
Choose
(1)
Windows
(1)
Dec
(1)
Reproduces
(1)
Inhibits
(1)
  Peter Duniho replied...
28-Dec-07 01:28 PM
Yes.  Assuming the control is properly referenced, either by being an
imported library or by being part of a project within the solution itself,
it should show up in the Toolbox.

I don't know off-hand what the problem might be.  I suspect there's some
sort of error in the implementation of the control.  One way to test that
would be to build the exact control as a library, and import it into a
completely different solution's project and see if it shows up there.  I
would guess that it won't.

If it doesn't, then you need to figure out what's wrong with the control
implementation.  You may want to post a _concise_ but complete sample of
code that reproduces the problem, since otherwise it's not really possible
for anyone to comment specifically on what's wrong.

If the control does show up when imported into a different solution, then
I really don't know.  It seems likely that that means there's something
about the solution in which it's contained that is somehow suppressing it,
but what that could be I have no idea.

Another test you might do is to create a brand new empty solution, and add
a new Custom Control class to the solution, to see if it shows up in the
toolbox.  That way you know for sure there's nothing that you might have
added to the class that would cause a problem.  If it doesn't show up in
that scenario, there's definitely something odd going on with VS.  If it
does show up in that scenario, that's further support for the theory that
you've got something particularly wrong in the custom control that's not
showing up, probably related to code you added yourself.

Finally, I suppose it's possible that there's some user setting that
inhibits controls from showing up in the Toolbox, but what that might be I
don't know, and it seems odd that it would apply only to a control from
within the same solution.

Pete
  allan christainson replied to JTC^..^
24-Mar-10 02:47 PM
To use a custom control from the Toolbox I had to select a category (general) and right click.  This brought up a menu where I selected "Choose Items...".  From there I browsed to the DLL where my control was found.
Create New Account
help
Visual Studio 2005 and Visual Studio 2008 on same system? .NET Framework Can Visual Studio 2005 be installed and used on the same system as Visual Studio 2008 ? and for bonus
Visual Studio 2005 & 2003 .NET Framework Is there a way to work on visual studio 2003 projects using visual studio 2005 without converting to 2005 and maintaining original code of 2003? Thanks AM Visual Studio Development
Visual Studio 6.0 macros in Visual Studio 2005 IDE? .NET Framework Can Visual Studio 6.0 macros be used in the Visual Studio 2005 IDE, or do they all have to be re-coded? Visual Studio Extensibility
visual studio 2005 dev and sql 2005 dev .NET Framework I have the 2 cd's for SQL Server 2005 Development. Where do I find the Visual Studio 2005 Developer install? Thanks. Visual Studio General Discussions SQL Server 2005 (1) Visual Studio 2005 (1
Visual Studio 2005 Team edition for Software Developers and Web Site .NET Framework Hello, I have run a same problem couple of times. Visual Studio 2005 is installed from Visual Studio 2005 Team edition for Software Developers dvds and after installation Creating Web Site is missing