dcsimg
Results 1 to 16 of 16

Thread: Custom controls not showing up in toolbox

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Custom controls not showing up in toolbox

    Hey,

    I have a solution with about 5 projects, the main (startup) project is a windows forms project while the others are control libraries that contain some custom controls. The main winforms project however also contains some custom controls.

    Recently, the controls in the main winforms project have stopped appearing in my toolbox. The controls from the other control library projects appear just fine, but none of the controls in my main project will show...

    Some of the projects are VB, some are C#.

    I have tried everything I know to fix it:
    • Delete bin/debug folders and restart
    • Build, build, build, build, and build
    • Target the same .NET Framework version and CPU platform in all projects
    • Build again

    Nothing works...

    All projects target .NET Framework 4.0 and compile for the x86 platform (since I am using Access db). All projects build successfully, no errors. I can run the solution just fine. I can even declare and add the controls in code and they work just fine. They just don't show up in the toolbox so I can't drag them to my form and I have to dig into the designer code everytime, which is really annoying!

    Any idea what could cause this beside what I've already tried??

  2. #2
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,781

    Re: Custom controls not showing up in toolbox

    Couple of things to try:

    Tools -> Options -> Windows Forms Designer -> General : AutoToolboxPopulate

    (not got 2010 to try that tho)

    And there is a show all context option on the toolbar as well which sometimes hides things.

    Also heard of having a space in a project name might cause this, but that was a google result.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: Custom controls not showing up in toolbox

    Thanks, but no luck. The AutoToolboxPopulate setting was already True. The Show All option in the context menu of the toolbox simply shows the categories that aren't relevant for the current project (such as WPF and ASP.NET controls), turning it on does not show the controls in the current project either...

    I now tried everything I could think of including unloading/reloading the projects in every order, nothing helps...

    I have half a mind to start a new solution and add the files back manually, but it might happen again and I don't feel like doing this all the time :S

    One final detail I forgot to mention is that the project files are on a Dropbox folder (so I can access them from my laptop as well). I don't see how that should affect it though, in the end the Dropbox folder is just any ordinary folder, except there's some application monitoring its changes and uploading them, right?

  4. #4
    Fanatic Member ThomasJohnsen's Avatar
    Join Date
    Jul 2010
    Location
    Denmark
    Posts
    528

    Re: Custom controls not showing up in toolbox

    I have had this happen before in an older version of the framework (mainly with inherited controls though - usercontrols allways seemed to get added). I remember trying alot of things, which you ofc have already been through. But just to be on the safe side: right-click on toolbox and 'Reset Toolbox' or 'Choose items' may solve the problem.
    I remember once actually having to add the control through code. And iirc that made the framework 'detect' it and add it to the toolbox (oh just reread the OP and you have tried this to no avail - so I guess this post is just a placeholder )
    Neither are solutions though for several DLLs with multiple controls.
    In truth, a mature man who uses hair-oil, unless medicinally , that man has probably got a quoggy spot in him somewhere. As a general rule, he can't amount to much in his totality. (Melville: Moby Dick)

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Re: Custom controls not showing up in toolbox

    The problem is not having several DLLs (actually, several projects, during design-time I think that's something different?) because the controls from the other projects are all there. Just the main (startup) project isn't. Not for UserControls, inherited controls, nothing.

    I'll try Reset Toolbox later. Is there an option to make a backup of it in case it doesn't work, because I have a few custom categories that I'd like to keep...

    Last option I can try is Choose Items and selecting the executable, but that shouldn't be necessary...

  6. #6
    New Member
    Join Date
    Sep 2011
    Location
    Philippines
    Posts
    14

    Re: Custom controls not showing up in toolbox

    Have you tried to place this on top of your class?

    <ToolboxItem(True)> _
    Public Class MyControl
    Inherits Control
    End Class



    This is my first post. Just a trial.

  7. #7
    Addicted Member
    Join Date
    Nov 2010
    Location
    TamilNadu, India
    Posts
    249

    Re: Custom controls not showing up in toolbox

    i already faced like this ......
    please delete all compiled lib from "bin>Debug" and also delete from "obj\x86\Debug" then rebuild....

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Apr 2007
    Location
    The Netherlands
    Posts
    5,070

    Wink Re: Custom controls not showing up in toolbox

    Quote Originally Posted by medsont View Post
    i already faced like this ......
    please delete all compiled lib from "bin>Debug" and also delete from "obj\x86\Debug" then rebuild....
    Read my first post again... That's the first thing I tried.

    In the mean time I tried Choose Items and browsed to the compiled executable. That worked a bit... It added about half my controls, the other half is still missing :s

    I checked the missing controls for errors but there aren't any, I'm not doing anything strange with custom designers or anything, its just a class that inherits Label and draws a gradient background ...

  9. #9
    Addicted Member
    Join Date
    Nov 2010
    Location
    TamilNadu, India
    Posts
    249

    Re: Custom controls not showing up in toolbox

    yes i already read it Thissen but you r mention about "bin>Debug" folder not about "obj\x86\Debug" so post it.......
    both folders are different purposes .......
    http://www.velocityreviews.com/forum...eferences.html

  10. #10
    Addicted Member
    Join Date
    Nov 2010
    Location
    TamilNadu, India
    Posts
    249

    Re: Custom controls not showing up in toolbox

    Nick i got this point from my previous post ........["if you build a 2nd time, it doesn't rebuild the entire
    project and can reuse some of the stuff from the first time in obj to make the build faster"]

  11. #11

  12. #12
    New Member
    Join Date
    Sep 2011
    Location
    Philippines
    Posts
    14

    Re: Custom controls not showing up in toolbox

    Nick have you tried to place this on top of your custom control?

    <ToolboxItem(True)> _
    Public Class MyControl: Inherits Label
    End Class

  13. #13

  14. #14
    Member
    Join Date
    Sep 2010
    Location
    Huntsville, AL
    Posts
    62

    Re: Custom controls not showing up in toolbox

    Was this issue ever resolved?

  15. #15

  16. #16
    New Member
    Join Date
    May 2014
    Posts
    1

    Cool Re: Custom controls not showing up in toolbox

    Quote Originally Posted by Mr.Nigma View Post
    Nick have you tried to place this on top of your custom control?

    <ToolboxItem(True)> _
    Public Class MyControl: Inherits Label
    End Class
    NOTE: this fix WORKED FOR ME...THX!! I created a custom ListView control to fix the selection of 'white' space in list view...ie, not selecting a listview item...if you are interested, check this out: http://stackoverflow.com/questions/2...-from-deselect ... complex fix...for what Microsoft should have thought of...anyway...this is one for the learning curve...nice tip!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width