I'm using Visual Studio 2005 for a project I'm working on right now. I've created a new, custom control that inherits from 'UserControl'. Now I need to add that control to another Windows Form within the same project. I thought that the IDE would place this cu开发者_如何转开发stom control into the Toolbox (as I know it's done in the past when I was using Visual Studio 2008), however, it did not. Now, I'm unsure how to get the control added to my form correctly and/or how to make it show up as it should in the Toolbox. The "Auto Toolbox Populate" option under Tools is set to 'True', so I really don't know what else needs to happen at this point. The help of anyone who's had any experience with this would be greately appreciated. Thanks a lot!
You may first build your custom control and create a dll. Then,
Right-click on the Toolbox panel -> Select 'Choose Items' -> Go to '.NET framework components' tab in the 'Choose Toolbox Items' dialog box that appears - > Browse to the dll of your custom user control -> Click OK.
Now the user control will be displaying in your tool box.
Hope this helps...
Try this
- Open Solution
- Build project
- Open your form
- Reset the toolbox
- Drag the user control from solution explorer to the toolbox
- Close the toolbox and all open documents
- Open toolbox then the form
- User control should appear
worked for me.
精彩评论