VB.net 设计器错误.. 我该如何解决? [英] VB.net designer error.. how do I resolve it?

查看:51
本文介绍了VB.net 设计器错误.. 我该如何解决?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在 Visual Basic 2010 express 中打开我的一个表单的设计器时出错,我可以选择忽略它,所以我点击了它(我很后悔这样做),现在我的表单被删除了,但我仍然有它的代码.我尝试右键单击并选择显示设计器,但它只会显示一个空白表单.我有一个名为DataGrid1"的数据网格控件,当我尝试向空白表单添加一个新控件时,它说DataGrid1"已经存在,但它没有.所以在我解决了前 85 个错误后,我又发现了一个没有意义的错误:

I got an error when I tried to open the designer for one of my forms in Visual Basic 2010 express and I had the option to ignore it so I clicked that (which I regret doing so much) and now my form is erased, but I still have the code for it. I tried right clicking and selecting show designer but it just brings up a blank form. I had a datagrid control called "DataGrid1" and when i tried adding a new control to the blank form it says that "DataGrid1" already exists but it doesn't. So after I resolved the first 85 errors I got one more that doesn't make sense:

错误 1 ​​在Resources"参数中多次指定了项目obj\x86\Debug\WindowsApplication1.frmMain.resources".Resources"参数不支持重复项.示例 1

Error 1 The item "obj\x86\Debug\WindowsApplication1.frmMain.resources" was specified more than once in the "Resources" parameter. Duplicate items are not supported by the "Resources" parameter. Example 1

如果有人知道这意味着什么以及如何解决它,我将不胜感激,因为我现在无法选择丢失此应用程序.

If anyone knows what this means and how to fix it I would appreciate it so much because losing this application isn't an option for me right now.

操作系统:Windows 7 x64软件:Visual Basic 2010 Express语言:VB.net

OS: Windows 7 x64 Software: Visual Basic 2010 Express Language: VB.net

推荐答案

我假设您正在使用 Windows 窗体进行编程.转到您的解决方案资源管理器,选择您的项目并单击解决方案资源管理器顶部的显示所有文件图标.然后,您应该能够展开 frmMain.vb 以查看所有子文件.查找 frmMain.Designer.vb 并检查它是否有重复的资源条目.如果这不起作用,请尝试清洁您的解决方案.发生的事情是设计器有错误,一旦您丢失了表单,您仍然拥有具有 InitializeComponent 方法的设计器文件,该方法可以创建和初始化您的所有控件,您真的不应该编辑此文件,因为它会在您添加时自动修改控件.在您的情况下,您可以从您的文件中删除声明,然后在您的设计器中添加组件,这些组件应该在您的 Designer.vb 文件中重新创建信息.

I am assuming you are programming in Windows forms. Goto to your Solution Explorer, Select your project and click on the show all files icon at the top of the Solution Explorer. You should then be able to expand out your frmMain.vb to see all the sub files. Look for a frmMain.Designer.vb and check it for a duplicate resource entry. If that doesn't work try cleaning your Solution. What happened is the designer had an error and once you lost the form you still had the Designer file which has the InitializeComponent method which creates and initializes all of your control, you really are not supposed to edit this file because it automatically modified when you add controls. In your case you may be able to remove the declarations from your file and then add the components in your designer which should recreate the information in your designer.vb file.

这篇关于VB.net 设计器错误.. 我该如何解决?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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