C # Custom controls do not appear in the toolbox after adding references to the workaround

Source: Internet
Author: User

Let me start with some background:

When developing a C # project, I found that many of the controls were reused, and the properties of the control were set to the same, and I wondered if I could set a class to hold the control, so that I could add a special operation to it every time I used it, without having to set the properties of the control again.

For a while, a custom control can be a requirement, and it can develop custom controls that inherit existing controls so that I can encapsulate my own library of controls.

After completing the custom control, I added this reference to another project based on MSDN's demo guide (e.g., Combutton), but in the next step there was a problem, and I found that my custom control was not being searched in the toolbox, that is, it was not displayed. I can't use it.

Finally I solved the problem, and for myself or to be able to help others, I recorded the solution here.

  cause 1: No references were added. in the project that needs to use this custom control, in the reference, right-click, add Reference, browse, find the DLL (for example: ComButton.dll), add, at this time, the control should be able to automatically add to the Toolbox. If not, then keep looking down.

  

  cause 2: The AutoFill Toolbox is not set to true. in Visual Studio, select Tools, Options, Windows Forms Designer, general, auto-populate toolbox set to True. Or that sentence, if the control does not appear, continue looking down.

  

  cause 3: You need to add it manually into the toolbox. my problem is here, too. In the Toolbox, right-click, select items, the. NET Framework Components page (the first load will be a bit slow, patience, etc.), at this time, the inside is not find our control, need to click Browse, find the DLL, add, click OK.

  

  

With the top three steps, this problem should all be resolved, if not, there may be a problem with VS or need to re-open vs.

C # Custom controls do not appear in the toolbox after adding references to the workaround

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.