0

I'm not sure what to call this. I've made a C# program that contains GUI controls/components for the Visual Studio Toolbox. Once you add the *.CS source it automatically adds the controls into the toolbox:

enter image description here


However once I made this into a DLL, I then tried to:

  • Add a Reference to the DLL
  • Add it as an existing item
  • Right clicking on toolbox -> Choose Items

None of these options automatically display my custom components. I do not want to use a User Control form, so how can I make a *.DLL instead of a *.CS file to show components in the toolbox?

EDIT: You need to make it public :) Thanks 'newb'.

K_X
  • 173
  • 9
  • 1
    Right click on the toolbox and select choose items. Then you can browse to the dll. – John Koerner Jan 12 '13 at 21:19
  • Forgot to mention Spike has already tried this. Spike gets an error on how it doesn't contain any components. – K_X Jan 12 '13 at 21:41
  • Are these controls public? Do they have the correct constructors? They might need a public no-parameter constructor. – John Saunders Jan 12 '13 at 22:04
  • That's the part Spike is not sure about, Spike has tried to make it public but it becomes inconsistent for the accessibility. How can Spike make this constructor in order for the controls to become public? – K_X Jan 12 '13 at 22:08
  • 1
    If you are getting inconsistent accessibility errors when you make a class public, then the class likely contains references to other classes that are not public, ie: a property with a return type of an internal or private class. – newb Jan 12 '13 at 22:20
  • Ah how dumbfound of Spike, thank you very much. – K_X Jan 12 '13 at 22:30

1 Answers1

0

Some parts of my class wasn't public and couldn't be used by the toolbox. Thanks 'newb'! I had forgot to change the accessibility.

K_X
  • 173
  • 9