如何在设计模式下将用户控件从dll(已引用)添加到ui?
如果我首先将其添加到工具箱,则会抛出异常,表示该 dll 已被引用。
我讨厌以编程方式将其添加到用户界面中。
有什么想法吗?我必须以编程方式添加它?
If i first add it to the toolbox, an exception will be thrown, saying the dll is already referenced.
and i hate to add it to ui programmatically.
any idea? i have to add it programmatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
删除以前的引用并浏览到 dll 怎么样?
how about removing previous reference and browsing to the dll ?
首先向您的项目添加一个新的用户控件
编码完成后,然后构建您的项目。这样您就会看到您创建的控件出现在工具箱(顶部)中,然后只需拖动并单击即可。将其放在您的表单或任何 ui 上,如果您想从 DLL 加载控件,只需在工具箱中添加一个新选项卡,然后右键单击它并选择“选择项目...”,然后在 .Net Framework 组件中选项卡单击“浏览”并导航到您的 dll ,然后打开 dll 文件并确认选择项目对话框,您会看到用户控件现在已准备好进行拖放。放入你的工具箱:)
firs add a new user control to your project
after coding has finished, then Build your project. so you'll see the your created control appears in the toolbox(at the top), then just drag & drop it on your form or any ui and if you want to load a control from a DLL just add a new tab in your tool box then right click on it and select "choose items..." and then in the .Net Framework Components tab click "browse" and navigate to your dll , and then open the dll file and confirm the choose items dialog and you see the user control is now ready for drag & drop in your tool box :)