Sign in to follow this  
DvDmanDT

[.net] Adding a custom control to a form

Recommended Posts

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..?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this