不能把表格用户控制 [英] Cannot Place User Control on Form

查看:148
本文介绍了不能把表格用户控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了使用VS2010 C#的WinForms应用程序。我是新来创建用户控制,所以我创建了一个新的用户控件(作为同一项目的一部分)。

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.

无法加载工具箱项TagGroup。它将从工具箱中删除。

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?

推荐答案

我终于想通这一个。

我正与使用两个类库组件项目。虽然这些都没有关系,我讨论了控制,我看见这两个库有平台目标的属性。|生成选项卡中设置为任何CPU

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

在另一方面,我的应用程序有这个设置中设置为64。通过改变我的应用程序的设置为任何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.

去图...

这篇关于不能把表格用户控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆