I've created a C# WinForms application using VS2010. I'm new to creating user controls so I created a new user control (as part of the same project).
When I rebuild the project, the new control appears in the toolbox. And when I drag the control from the toolbox onto a form, I get the following error.
Failed to load toolbox item 'TagGroup'. It will be removed from the toolbox.
This happened the only other time I created a user control as well. I've searched the web but most answers I found seemed related to having the control in a separate assembly. (Note that I found plenty of questions with the same problem I'm having.)
Can anyone suggest where I should look next?
Add the control by drawing Select the control by clicking on it. In your form, drag-select a region. The control will be placed to fit the size of the region you selected.
User controls are a way of making a custom, reusable component. A user control can contain other controls but must be hosted by a form.
My application need to be 64-bit. In order to use custom user controls in the designer I just added a new project to my solution. This new project use the "AnyCPU" setting and contains all my user controls.
My solution contains the following projects:
Works like a charm and it's clean
By the way, there is a Microsoft support article about that issue.
Source: http://support.microsoft.com/kb/963017
I finally figured this one out.
The project I'm working with uses two class-library assemblies. Although these have nothing to do with the control I'm discussing, I looked and saw both libraries have Platform Target in the Properties|Build tab set to "Any CPU".
On the other hand, my application had this setting set to "x64". By changing my application's setting to "Any CPU", I can now place my user controls onto my forms.
Go figure...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With