开发者

Adding Custom UserControl to Visual Studio 2005's Toolbox

开发者 https://www.devze.com 2023-01-20 21:03 出处:网络
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 wit

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

  1. Open Solution
  2. Build project
  3. Open your form
  4. Reset the toolbox
  5. Drag the user control from solution explorer to the toolbox
  6. Close the toolbox and all open documents
  7. Open toolbox then the form
  8. User control should appear

worked for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消