0

I'm working on a windows form application in C# VS2010.

I found on the internet an implementation of a User-Control that I want to use in my project.

Problem: how can I import or include it so I will be able to see it in my Toolbox ?

I copied the UserControl directory into my project directory(see attached photo) and then build the project and got this warning:

Error 1 Unable to create a manifest resource name for "RecessEditorControl.resx". Could not find file 'C:\Users\bassam\Desktop\comm\Projects\Thunder Archive\Thunder Archive\RecessEditorControl.cs'. Thunder Archive

enter image description here

any idea how it should be done?

ThunderWiring
  • 738
  • 1
  • 7
  • 29
  • 1
    Check this, http://stackoverflow.com/questions/8931328/how-do-i-add-my-new-user-control-to-the-toolbox-or-a-new-winform – Shyju Apr 08 '15 at 09:08

2 Answers2

1

Open the user control project separately (outside of your solution) and attempt to build it. If the build fails, search for help from the control author(s) on what dependencies are needed and how you can build the control.

After you get it sucesfully built, there will be a .dll file in the bin/ folder (where config is most likely debug or release, depending on what configuration you used to build the project)

Reference this .dll from the windows desktop solution you are working on. Add it to the references section of your UI project. It should automatically show up in the toolbox if it is properly coded as a user control.

There is the option of including the entire source project of your control in your win app solution, you can try this later if you verify that you are able to build the control on it's own. Although I would not recommend this approach unless you intent to actively continue developing the user control.

irreal
  • 2,217
  • 18
  • 23
  • what do you mean to "including the entire source project"? so that if i want to make a change in the userControl i don't need to rebuild it and copy-past that .dll? – ThunderWiring Apr 08 '15 at 09:32
  • You can reference the dll from the bin folder of the control project and it will still update if you change the user control. What I was referring to is adding the entire userControl project to your solution, so that it's always available for quick navigation / editing while working on the main project and so it's part of the same solution. This step is completely optional and in my opinion not needed in your case. – irreal Apr 08 '15 at 11:39
0

You separately build user control to create a dll. After that include the dll in your app executable folder. When you switch to designer, you will see the control appears on the toolbox with the control name. Just drag n drop...

Shyju
  • 203
  • 1
  • 5