views:

109

answers:

2

I made a usercontrol in my project, and after building project, I need to put it in my toolbox, and use it as a common control. but i can't. the usercontrol is in my project namespace, and I tried Choose Item in rightclick menu, but I didn't find a way to add it.

A: 

As far as I know you can drag&drop your usercontrol in your current project to the toolbox. The problem is when you choose a different project the user control is gone. So I think you have to build a separate control library project:

In your solution, add a new project, however as a project template choose "Class Library". In THAT project, add a user control, and do everything you need to do. Once that's done, build it, and you'll have yourself a dll file (it can easily be found in the projects bin/debug folder.)

You can add this dll to your toolbox (right click add...) and it will stay there in all projects!

MUG4N
I dragged and dropped, but nothing happened.
saeed
MUG4N
+3  A: 

Right-click on toolbar then click on "choose item" in context menu. A dialog with registrated components pops up. in this dialog click "Browse" to select your assembly with the usercontrol you want to use.

PS. This assembly should be registrated before.

Arseny
Can you explain 'registered before' ? I don't think that's required.
Henk Holterman