如何使其他 dll 中的组件可以在 VS 2005 Toolbox 中访问?
我将 VS 2005 中的“工具->选项->Windows 窗体设计器->常规->AutoToolboxPopulate”属性设置为 true。
我在项目中引用带有(公共)自定义组件和表单的 DLL 文件,但这些组件不在工具箱中。我尝试以编程方式将它们添加到“MyForm.Designer.cs”文件中,但这只是搞乱了设计器。
如此令人恼火的问题。一直没能解决这个问题。有谁知道如何使这些组件出现在工具箱中?
I have the "Tools->Options->Windows Forms Designer->General->AutoToolboxPopulate" property in VS 2005 set to true.
I am referencing a DLL file with (public) custom components and forms in my project, but the components are not in the Toolbox. I tried adding them programmatically in the "MyForm.Designer.cs" file, but that just messed up the designer.
Such an aggravating issue. Never been able to solve this. Does anyone know how to make these components appear in the Toolbox?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要手动将它们添加到工具箱。为此,请按照下列步骤操作:
右键单击工具箱,然后从上下文菜单中选择“选择项目”。
在出现的对话框中,确保选择第一个选项卡(“.NET Framework 组件”)。
单击选项卡页底部附近的“浏览”按钮。
导航到包含自定义控件/组件的 DLL 文件,然后将其打开。
任何可访问的组件都应添加到列表框中,并自动检查。如果您想从库中选择要排除的特定组件,请立即取消选中它们。
单击“确定”。您选择的所有组件都应添加到工具箱中。
如果/当您决定从工具箱中删除这些自定义项目时,只需右键单击它,然后从上下文菜单中选择“重置工具箱”即可。这将删除您添加的所有项目,并将工具箱的内容恢复为其默认项目。
You need to add them to the toolbox manually. To do so, follow these steps:
Right-click on the toolbox, and select "Choose Items" from the context menu.
In the dialog that appears, make sure that the first tab (".NET Framework Components) is selected.
Click the "Browse" button near the bottom of the tab page.
Navigate to the DLL file that contains your custom controls/components, and open it.
Any accessible components should be added to the listbox, and automatically checked. If you want to choose specific components from the library to exclude, uncheck them now.
Click OK. All of the components that you selected should be added to the toolbox.
If/when you ever decide to remove those custom items from your toolbox, you can simply right-click on it, and select "Reset Toolbox" from the context menu. This will remove any items that you have added, and restore the contents of the toolbox to its default items.