[.net] Adding a custom control to a form

Started by
1 comment, last by Rubenknex 13 years, 1 month ago
Hi everyone. This is a bit embarrassing to ask, but how on earth do you add a custom control to a System.Windows.Form? How can you get it to the toolbox? The only way I found so far is by hacking the Form.designer.cs and add it manually. Is there seriously no way to add a control in the same or a referenced project using the designer?

I can do it by compiling and then using the Choose items dialog select the projects exe/dll, but that seems extremely ugly..?
Advertisement
That is the normal way unless the Custom Control is in the same solution as the project you are trying to use it in (which will auto-populate into the toolbox) . I usually just create a new tab in the toolbox and just add it via the Choose items dialog.
Its not a bug, its a feature!!
I currently have a form with a custom control that's defined in a referenced project, maybe you should go to Tools->Options->Windows Forms Designer and then set the AutoToolBoxPopulate property to True, then rebuild your solution and it should show up in the toolbox.

This topic is closed to new replies.

Advertisement